Opened 7 years ago
Closed 7 years ago
#6348 closed defect (fixed)
GUINTBIG_MAX in cpl_port.h needs explanation
Reported by: | Kurt Schwehr | Owned by: | Even Rouault |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description
GUINTBIG_MAX could a comment to explain why the HAVE_LONG_LONG case uses a signed constant that is shifted left. Why are we using a signed value here? This was done in r31066.
#if defined(WIN32) && defined(_MSC_VER) #define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFFU) << 32) | 0xFFFFFFFFU) #elif HAVE_LONG_LONG #define GUINTBIG_MAX (((GUIntBig)(0xFFFFFFFF) << 32) | 0xFFFFFFFFU) // ^ casting an signed value to unsigned? #else #define GUINTBIG_MAX UINT_MAX #endif
Note:
See TracTickets
for help on using tickets.
Good catch. More than an explanation, it needed a fix :
r33331 "Fix definition of GUINTBIG_MAX in HAVE_LONG_LONG case to use only unsigned constants (trunk only, #6348)"