Opened 4 years ago

Closed 4 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

Change History (1)

comment:1 Changed 4 years ago by Even Rouault

Resolution: fixed
Status: newclosed

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)"

Note: See TracTickets for help on using tickets.