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

--- Comment #19 from Chen Gang <gang.chen.5i5j at gmail dot com> ---
I build linux kernel with allyesconfig under x86_64 for linux-next tree
20160122. I can find some related cases for BUG28901 (but they are not quite
much), one case is below:

  CC      drivers/acpi/sbshc.o
In file included from drivers/acpi/sbshc.c:17:0:
drivers/acpi/sbshc.h:17:17: warning: ‘SMBUS_PEC’ defined but not used
[-Wunused-const-variable]
 static const u8 SMBUS_PEC = 0x80;
                 ^~~~~~~~~

For me, I dislike -Wno-unused-const-variable option, the reason is "when C
programmers use static const int variable, in most cases, they want to use them
instead of #define".

So for me, -Wunused-variable need skip static const int variable warning. If
anyone wants to warn about it, they can add additional option (e.g.
-Wunused-const-int-variable) to let C compiler report warning for it.

Thanks.

Reply via email to