Additionally check __LONG_MAX__ for defining curl_off_t. #2216

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@jimis
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.
@jimis

This comment has been minimized.

Show comment Hide comment
@jimis

jimis Jan 4, 2018

Contributor

An alternative to #2214.

Contributor

jimis commented Jan 4, 2018

An alternative to #2214.

@jimis

This comment has been minimized.

Show comment Hide comment
@jimis

jimis Jan 8, 2018

Contributor

The one test build that failed is spurious?

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

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

bagder approved these changes Jan 9, 2018

I think this looks fine and safe!

@bagder

This comment has been minimized.

Show comment Hide comment
@bagder

bagder Jan 9, 2018

Member

Thanks!

Member

bagder commented Jan 9, 2018

Thanks!

@jay

This comment has been minimized.

Show comment Hide comment
@jay

jay Jan 9, 2018

Member

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

Member

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

@lock lock bot locked as resolved and limited conversation to collaborators May 9, 2018

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