--- 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
--- 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.
--
--- 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
--- 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
--- 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.
--