[Bug c/104205] Signed overflow in case label reports confusing warning with -Wpedantic

2022-01-24 Thread joseph at codesourcery dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104205 --- Comment #5 from joseph at codesourcery dot com --- Printing an expression within the diagnostic message is generally problematic, but it might be good to change the caret location to point to the expression rather than the keyword "case"

[Bug c/104205] Signed overflow in case label reports confusing warning with -Wpedantic

2022-01-24 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104205 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org ---

[Bug c/104205] Signed overflow in case label reports confusing warning with -Wpedantic

2022-01-24 Thread stephen.wassell at sophos dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104205 --- Comment #3 from Stephen Wassell --- Thank you for the response! I think the cause of our confusion was that we were focusing on "constant" in the warning message rather than "integer". Our original code had a few layers of macros so the

[Bug c/104205] Signed overflow in case label reports confusing warning with -Wpedantic

2022-01-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104205 --- Comment #2 from Andrew Pinski --- > It should say something about undefined behaviour instead. The problem is for integer constants, it is not undefined at runtime but rather invalid code at compile time. >Should there also be a warning

[Bug c/104205] Signed overflow in case label reports confusing warning with -Wpedantic

2022-01-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104205 Andrew Pinski changed: What|Removed |Added URL|https://godbolt.org/z/4Tr1q | |xaqv