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

Paul Eggert <eggert at gnu dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eggert at gnu dot org

--- Comment #10 from Paul Eggert <eggert at gnu dot org> ---
This topic came up on the libc-alpha mailing list.  The proposed change would
break compilation of tzcode, which has a private header that defines static
constants not all of which are used in every file that includes the header.

In tzcode the problem can be worked around by using a #define rather than a
static constant, but many C programmers nowadays prefer avoiding #define when
possible, and static constants let you do that in many cases. (An enum wouldn't
work for the tzcode case, as the values might be outside int range.)  Also, in
many environments macros are invisible to the debugger but static constants are
visible, so the static constants are nicer for people debugging their code.

This reminds me of when gcc -Wmissing-declarations used to diagnose every
C99-style inline function in an include file (GCC bug 63877). The warning was
put in and tested, but the tests used only old-fashioned C programming styles,
and the warning caused real problems by people using a more modern C style.

It'd be fine to add an option to enable the new warning, but please don't
enable them merely because -Wall or -Wunused-variable is specified.

Reply via email to