This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28901] -Wunused-variable ignores unused const initialised variables
- From: "eggert at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Sep 2015 04:51:43 +0000
- Subject: [Bug c/28901] -Wunused-variable ignores unused const initialised variables
- Auto-submitted: auto-generated
- References: <bug-28901-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901
--- Comment #12 from Paul Eggert <eggert at gnu dot org> ---
(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 reasonable suggestion; it would fix the cry-wolf problem for
tzcode, which is what prompted me to object to the original proposal.
The alternative of littering the code with many instances of __attribute__
((unused)) (or is it __attribute ((used)? I can never remember) is less
appealing.