[Bug c/28901] -Wunused-variable ignores unused const initialised variables

josh at joshtriplett dot org gcc-bugzilla@gcc.gnu.org
Mon Feb 15 19:00:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901

--- Comment #24 from Josh Triplett <josh at joshtriplett dot org> ---
Also, even the documentation seems unfortunate: "In C++ this is normally not an
error since const variables take the place of #defines in C++."

Why would C code not do this too?  The GCC documentation should not steer
people away from this practice in C, or imply that there's something wrong with
it.


More information about the Gcc-bugs mailing list