COMP: Remove warning about assigning 0x8000000000000000L to long long
This commit is contained in:
parent
e46b0a9290
commit
fbaead2a09
|
@ -521,3 +521,15 @@ main () {
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_LONG_LONG_CONSTANT
|
||||
int main()
|
||||
{
|
||||
long long c = 0x8000000000000000LL;
|
||||
long long k = 0x7FFFFFFFFFFFFFFFLL;
|
||||
if ( c == 0x8000000000000000LL && c != k )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -446,6 +446,7 @@ ENDIF(HAVE_FILE_OFFSET_BITS)
|
|||
FOREACH(CURL_TEST
|
||||
HAVE_GLIBC_STRERROR_R
|
||||
HAVE_POSIX_STRERROR_R
|
||||
HAVE_LONG_LONG_CONSTANT
|
||||
)
|
||||
CURL_INTERNAL_TEST_RUN(${CURL_TEST})
|
||||
ENDFOREACH(CURL_TEST)
|
||||
|
|
|
@ -504,3 +504,6 @@
|
|||
|
||||
/* the signed version of size_t */
|
||||
#cmakedefine ssize_t ${ssize_t}
|
||||
|
||||
/* define if the compiler supports number 0x3627676LL */
|
||||
#cmakedefine HAVE_LONG_LONG_CONSTANT ${HAVE_LONG_LONG_CONSTANT}
|
||||
|
|
|
@ -111,10 +111,17 @@ curlx_strtoll(const char *nptr, char **endptr, int base)
|
|||
}
|
||||
}
|
||||
else {
|
||||
#ifdef HAVE_LONG_LONG_CONSTANT
|
||||
if (is_negative)
|
||||
value = 0x8000000000000000LL;
|
||||
else
|
||||
value = 0x7FFFFFFFFFFFFFFFLL;
|
||||
#else
|
||||
if (is_negative)
|
||||
value = 0x8000000000000000L;
|
||||
else
|
||||
value = 0x7FFFFFFFFFFFFFFFL;
|
||||
#endif
|
||||
|
||||
errno = ERANGE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue