This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[warnings] tagging warnings about options themselves
- From: DJ Delorie <dj at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Jul 2005 21:58:50 -0400
- Subject: [warnings] tagging warnings about options themselves
In toplev.c there's code like this:
#ifndef DELAY_SLOTS
if (flag_delayed_branch)
warning (0, "this target machine does not have delayed branches");
#endif
If we put OPT_fdelayed_branch in there, we get messages like this:
dj.c:1: warning: this target machine does not have delayed branches [-fdelayed-branch]
Does that seem reasonable?
Also, I was thinking about messages like these:
warning (0, "command line option \"%s\" is valid for %s but not for %s",
text, ok_langs, bad_lang);
warning (0, "switch %qs is no longer supported", option->opt_text);
warning (0, "unrecognized gcc debugging option: %c", c);
How about a -Woptions warning?
I'm also pondering a -Wunconverted-warnings that we can use for all
other cases where we pass zero to warning(), so that we can assert a
non-zero value there to prevent new warnings from passing a zero. I'd
rather put *useful* values in there, of course, but I suspect there
may be warnings that don't easily fall into any -W option category,
even new ones. The other option is to just give those longer names to
"get them out of the way", like -Wcgraph-renamed-after-ref-in-asm.