[Bug c/44598] -Wunused-variable miss 'static const char x[] = ;'
--- Comment #5 from dimhen at gmail dot com 2010-07-18 12:40 --- 'functions as designed' -- dimhen at gmail dot com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44598
[Bug c/44598] -Wunused-variable miss 'static const char x[] = ;'
--- Comment #4 from jakub at gcc dot gnu dot org 2010-06-21 06:11 --- FYI, this has nothing to do with the new -Wunused-but-set-* warnings, the initialization in the definition isn't counted as set. This is something the old -Wunused-variable warning reports/doesn't report. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44598
[Bug c/44598] -Wunused-variable miss 'static const char x[] = ;'
--- Comment #2 from dimhen at gmail dot com 2010-06-20 07:32 --- (In reply to comment #1) Well... 1) so, gcc miss 'set-but-not-used' warning in testcase? 2) in testcase there are no more code to which 'x' may be inlined. Yes? 3) change test to static const char x[] = ; static const char const * b = ; changes nothing in diagnistics 4) add -O3 -Wextra changes nothing in diagnistics -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44598
[Bug c/44598] -Wunused-variable miss 'static const char x[] = ;'
--- Comment #3 from manu at gcc dot gnu dot org 2010-06-20 21:30 --- I think we do not warn on purpose because unused global static const strings are used often for storing version, metadata and stuff that may only be conditionally compiled after preprocessing. I would argue we should not warn for either case then. -- manu at gcc dot gnu dot org changed: What|Removed |Added CC||manu at gcc dot gnu dot org, ||jakub at redhat dot com Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-06-20 21:30:30 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44598
[Bug c/44598] -Wunused-variable miss 'static const char x[] = ;'
--- Comment #1 from pinskia at gcc dot gnu dot org 2010-06-20 00:37 --- Well I think this is on purpose really. In the array case, we can inline the value while in the other case, b itself is not const so it can be changed; that is be assigned to in normal code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44598