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

2016-11-08 Thread sarnila at adit dot fi
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #39 from Pekka --- Well this change did now hit me. We have a code base of thousands of modules for a set of industrial systems. Every now and then we must recompile for new platforms with new versions of things like gcc. And now is

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

2016-04-15 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Martin Sebor changed: What|Removed |Added CC||mueller at kde dot org --- Comment #38

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

2016-03-13 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #37 from Andrew Pinski --- Note this change also introduces some warnings when compiling the arm64 kernel: In file included from arch/arm64/crypto/aes-glue.c:17:0: include/linux/cpufeature.h:48:33: warning: ‘cpu_feature_match_AES’

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

2016-02-23 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Mark Wielaard changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|---

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

2016-02-23 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #35 from Mark Wielaard --- Note the followup patch needed for PR c/69911 https://gcc.gnu.org/viewcvs?rev=233627=gcc=rev

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

2016-02-23 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Marek Polacek changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment

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

2016-02-23 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #33 from Andreas Schwab --- make[3]: Entering directory '/opt/gcc/test/Build/lto-plugin' /bin/sh ./libtool --tag=CC --tag=disable-static --mode=compile /opt/gcc/test/Build/./prev-gcc/xgcc

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

2016-02-22 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #32 from Mark Wielaard --- Author: mark Date: Mon Feb 22 22:42:19 2016 New Revision: 233616 URL: https://gcc.gnu.org/viewcvs?rev=233616=gcc=rev Log: PR28901 Add two levels for -Wunused-const-variable. There is some controversy

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

2016-02-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #31 from Manuel López-Ibáñez --- (In reply to Mark Wielaard from comment #29) > > > + || filename_cmp (main_input_filename, > > > +DECL_SOURCE_FILE (decl)) == 0))) > > > > Better

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

2016-02-20 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #30 from Mark Wielaard --- https://gcc.gnu.org/ml/gcc-patches/2016-02/msg01433.html

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

2016-02-20 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #29 from Mark Wielaard --- (In reply to Manuel López-Ibáñez from comment #27) > (In reply to Mark Wielaard from comment #21) > > Although in C a static const is not really like a #define I suspect that > > there are cases where they

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

2016-02-20 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #28 from Mark Wielaard --- (In reply to Panu Matilainen from comment #26) > On main files warning on unused junk is certainly useful but static const is > commonly and deliberately used in headers (eg for arrays such as in comment >

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

2016-02-17 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #27 from Manuel López-Ibáñez --- (In reply to Mark Wielaard from comment #21) > Although in C a static const is not really like a #define I suspect that > there are cases where they are used as such in header files. If that is the >

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

2016-02-17 Thread pmatilai at laiskiainen dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Panu Matilainen changed: What|Removed |Added CC||pmatilai at laiskiainen dot org ---

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

2016-02-16 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #25 from Mark Wielaard --- (In reply to Josh Triplett from comment #23) > (In reply to Mark Wielaard from comment #21) > > Although in C a static const is not really like a #define > > Why not? Many C projects try to avoid the

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

2016-02-15 Thread josh at joshtriplett dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #24 from Josh Triplett --- 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

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

2016-02-15 Thread josh at joshtriplett dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Josh Triplett changed: What|Removed |Added CC||josh at joshtriplett dot org ---

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

2016-01-28 Thread gang.chen.5i5j at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #22 from Chen Gang --- (In reply to Mark Wielaard from comment #21) [...] > Although in C a static const is not really like a #define I suspect that > there are cases where they are used as such in header files. If that is the >

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

2016-01-26 Thread gang.chen.5i5j at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #19 from Chen Gang --- 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

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

2016-01-26 Thread gang.chen.5i5j at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #20 from Chen Gang --- (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

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

2016-01-26 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #21 from Mark Wielaard --- Sorry, I forgot about this bug still being open. It isn't clear to me whether the issues seen in the kernel sources are a) just legitimate and should be fixed (like comment #16 seem to imply) b)

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

2015-11-30 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #15 from Mark Wielaard --- (In reply to Andi Kleen from comment #14) > I'm building a current Linux kernel with allyesconfig, and this new warning > causes > 1383(!) new warnings in the build. > > I think this should be revisited

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

2015-11-30 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Markus Trippelsdorf changed: What|Removed |Added CC||trippels at gcc dot gnu.org ---

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

2015-11-30 Thread andi-gcc at firstfloor dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #17 from Andi Kleen --- There were a few false or useless ones (e.g. related to macros and specific build configs). I didn't look through them all, but various were semi legitimate, but also very minor (small) so fixing it won't

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

2015-11-30 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #18 from Markus Trippelsdorf --- Here is an example: ... static const struct pt_regs_offset x86_32_regoffset_table[] = { REG_OFFSET_NAME_32("%ax", eax), REG_OFFSET_NAME_32("%cx", ecx),

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

2015-11-29 Thread andi-gcc at firstfloor dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Andi Kleen changed: What|Removed |Added CC||andi-gcc at firstfloor dot org --- Comment

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

2015-09-19 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #13 from Manuel López-Ibáñez --- (In reply to Paul Eggert from comment #12) > (In reply to Manuel López-Ibáñez from comment #11) > > > Another alternative is to only warn if the variable is defined in the main > > file (MAIN_FILE_P)

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

2015-09-18 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Manuel López-Ibáñez changed: What|Removed |Added CC||manu at gcc dot gnu.org ---

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

2015-09-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #12 from Paul Eggert --- (In reply to Manuel López-Ibáñez from comment #11) > Another alternative is to only warn if the variable is defined in the main > file (MAIN_FILE_P) as opposed to an included file. Thanks, this is a

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

2015-09-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #10

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

2015-09-14 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #9 from Mark Wielaard --- Author: mark Date: Mon Sep 14 09:49:47 2015 New Revision: 227742 URL: https://gcc.gnu.org/viewcvs?rev=227742=gcc=rev Log: PR28901 -Wunused-variable ignores unused const initialised variables in C 12 years

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

2015-09-11 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #8 from Mark Wielaard --- Submitted a patch: https://gcc.gnu.org/ml/gcc-patches/2015-09/msg00847.html

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

2014-10-22 Thread petschy at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 petschy at gmail dot com changed: What|Removed |Added CC||petschy at gmail dot com ---

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

2014-08-08 Thread tromey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Tom Tromey tromey at gcc dot gnu.org changed: What|Removed |Added Status|RESOLVED|REOPENED Last

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

2014-02-11 Thread tromey at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Tom Tromey tromey at gcc dot gnu.org changed: What|Removed |Added CC||tromey at gcc dot

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

2014-01-16 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added CC||hjl.tools at

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

2014-01-16 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #3 from Andrew Pinski pinskia at gcc dot gnu.org --- From the code: /* We don't warn about static const variables because the rcs_id idiom uses that construction. */

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

2014-01-16 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #4 from H.J. Lu hjl.tools at gmail dot com --- (In reply to Andrew Pinski from comment #3) From the code: /* We don't warn about static const variables because the rcs_id idiom uses that construction. */ That is not

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

2006-09-18 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2006-09-19 05:13 --- This is not a bug but a feature. The reason is that const int usually shows up in header files and usually are normally unused. -- pinskia at gcc dot gnu dot org changed: What|Removed