This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: warning message control: check for enabled warnings
DJ Delorie <dj@redhat.com> writes:
[...]
| /* Prototypes. */
| @@ -412,13 +413,20 @@ inform (const char *msgid, ...)
| /* A warning. Use this for code which is correct according to the
| relevant language specification but is likely to be buggy anyway. */
| void
| -warning (int opt ATTRIBUTE_UNUSED, const char *msgid, ...)
| +warning (int opt, const char *msgid, ...)
| {
| diagnostic_info diagnostic;
| va_list ap;
| + const char *a_msgid = msgid;
| +
| + if (opt && ! option_enabled (opt))
| + return;
| +
| + if (warn_show_options && opt)
| + a_msgid = ACONCAT ((msgid, " [", cl_options[opt].opt_text, "]", 0));
I think warn_show_options is not a "warning option", and should be
a field of "diagnostic_info" (diagnostic.h) -- it should be
-fdiagnostic-show-option, similar to
-fdiagnostic-show-location=[once,never]. OK with that change.
Thanks!
-- Gaby