This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]