[Bug c/115684] No warning for pointer and enum field comparison

2024-06-27 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115684 --- Comment #5 from Eric Gallager --- (In reply to Andrew Pinski from comment #4) > C++ has -Wzero-as-null-pointer-constant . > Maybe it should be added for C also for at least C23 where nullptr exists > now. > > Note for C++, the enum value is

[Bug c/115684] No warning for pointer and enum field comparison

2024-06-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115684 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug c/115684] No warning for pointer and enum field comparison

2024-06-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115684 Andrew Pinski changed: What|Removed |Added Keywords||diagnostic --- Comment #3 from Andrew P

[Bug c/115684] No warning for pointer and enum field comparison

2024-06-27 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115684 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org --- Commen

[Bug c/115684] No warning for pointer and enum field comparison

2024-06-27 Thread Hi-Angel at yandex dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115684 --- Comment #1 from Konstantin Kharlamov --- FWIW, IRL these cases happen during refactoring, when you factor out a code to a smaller function, and some variables from the original function become pointers. I honestly never even check the parame