[Bug c/28901] -Wunused-variable ignores unused const initialised variables
gang.chen.5i5j at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Jan 26 14:03:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901
--- Comment #20 from Chen Gang <gang.chen.5i5j at gmail dot com> ---
(In reply to Chen Gang from comment #19)
> 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;
> ^~~~~~~~~
Oh, sorry, this case is not suitable, it is -Wunused-const-variable.
But my opinion still like what I said in comment #19.
Thanks.
More information about the Gcc-bugs
mailing list