Additionally check __LONG_MAX__ for defining curl_off_t. #2216

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

jimis commented Jan 4, 2018

__SIZEOF_LONG__ was introduced in GCC 4.4, __LONG_MAX__ was introduced
in GCC 3.3.

Additionally check __LONG_MAX__ for defining curl_off_t.
__SIZEOF_LONG__ was introduced in GCC 4.4, __LONG_MAX__ was introduced
in GCC 3.3.
Contributor

jimis commented Jan 4, 2018

An alternative to #2214.

Contributor

jimis commented Jan 8, 2018

The one test build that failed is spurious?

EDIT: oh it looks green now, probably somebody triggered it again.

bagder approved these changes Jan 9, 2018

I think this looks fine and safe!

@bagder bagder closed this in 89f6804 Jan 9, 2018

Owner

bagder commented Jan 9, 2018

Thanks!

Owner

jay commented Jan 9, 2018

I think that this could warn warning: integer constant is too large for its type for generic gcc that doesn't support 9223372036854775807L. This would probably suppress it:

#if defined(__LONG_MAX__) && (__LONG_MAX__ > 2147483647L)
#  if (__LONG_MAX__ == 9223372036854775807L)
#    define CURL_PROBABLY_64_LONG
#  endif
#endif

and then later in the elif for lp64 where the check is now instead check if CURL_PROBABLY_64_LONG is defined
It seems kind of messy though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment