[Bug c++/114573] -Wzero-as-null-pointer-constant complains on enum with explicit cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114573 Albert Netymk changed: What|Removed |Added CC||albertnetymk at gmail dot com --- Comment #3 from Albert Netymk --- Maybe related. The first two invocations of `f` trigger a warning. Clang doesn't complain. ``` static const int g_zero = 0; void f(void* value); void g() { f(reinterpret_cast(0)); f(reinterpret_cast(g_zero)); int y = g_zero; f(reinterpret_cast(y)); } ```
[Bug c++/114573] -Wzero-as-null-pointer-constant complains on enum with explicit cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114573 --- Comment #2 from Pierre Ossman --- Indeed. It is part of an effort to have a more modern C++ style in TigerVNC. One item was preferring nullptr over NULL, and this issue became an obstacle there. Right now, we did a #pragma, but if there is a better workaround, then we are all ears.
[Bug c++/114573] -Wzero-as-null-pointer-constant complains on enum with explicit cast
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114573 Richard Biener changed: What|Removed |Added Keywords||diagnostic Last reconfirmed||2024-04-03 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener --- Confirmed. Note this diagnostic isn't enabled with -Wall or -Wextra.