- Code: Select all
/path/to/cef_90.6.6/include/internal/cef_types.h:1016:3: warning: ISO C restricts enumerator values to range of 'int' (4294967295 is too large) [-Wpedantic]
DRAG_OPERATION_EVERY = UINT_MAX
^ ~~~~~~~~
/path/to/cef_90.6.6/include/internal/cef_types.h:1257:3: warning: ISO C restricts enumerator values to range of 'int' (2147483648 is too large) [-Wpedantic]
TT_SERVER_REDIRECT_FLAG = 0x80000000,
^ ~~~~~~~~~~
/path/to/cef_90.6.6/include/internal/cef_types.h:1262:3: warning: ISO C restricts enumerator values to range of 'int' (3221225472 is too large) [-Wpedantic]
TT_IS_REDIRECT_MASK = 0xC0000000,
^ ~~~~~~~~~~
/path/to/cef_90.6.6/include/internal/cef_types.h:1267:3: warning: ISO C restricts enumerator values to range of 'int' (4294967040 is too large) [-Wpedantic]
TT_QUALIFIER_MASK = 0xFFFFFF00,
^ ~~~~~~~~~~
According to ISO/IEC 9899:1999:
The expression that defines the value of an enumeration constant shall be an integer
constant expression that has a value representable as an int.
So unless on platforms where an int is 64-bit wide (unfortunately not the case for either Windows, Linux or macOS), whenever we try something like:
- Code: Select all
cef_transition_type_t transition_type = TT_IS_REDIRECT_MASK;
We are converting a 64-bit integer to an 32-bit one (assuming LLP64 or LP64) that cannot represent the value, which is implementation-defined behaviour.
Perhaps the bitmasks could be redesigned? So that the code can be standard conformant, and some potention problems can be avoided.