#include <stdio.h> #include <stdint.h> enum big_enum { AAA = 0, BBB = UINT64_MAX }; int main() { enum big_enum my_enum = BBB; printf("size: %zu. val=0x%X\n", sizeof(enum big_enum), my_enum >> 32); return 0; }
Checking test.c ... test.c:9:68: error: Shifting 32-bit value by 32 bits is undefined behaviour [shiftTooManyBits] printf("size: %zu. val=0x%X\n", sizeof(enum big_enum), my_enum >> 32); ^
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11421
Log in to post a comment.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11421