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
- From: DJ Delorie <dj at redhat dot com>
- To: gdr at integrable-solutions dot net
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 May 2005 15:40:09 -0400
- Subject: Re: warning message control: check for enabled warnings
- References: <200504230001.j3N01RR8016620@greed.delorie.com><4269966E.1020708@codesourcery.com><200504230039.j3N0dWvp017120@greed.delorie.com><4269A6B7.7070402@codesourcery.com><200504232138.j3NLcscP001625@greed.delorie.com><200504252153.j3PLr5X9026266@greed.delorie.com><200504292255.j3TMtSFY013487@greed.delorie.com> <m3k6mkjtai.fsf@uniton.integrable-solutions.net>
> 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.
Changing the option is easy, but I'm confused about the other part -
did you just want me to copy the OPT_W* to the diagnostic_info, and
have diagnostic_report_diagnostic add the text to the message when
appropriate? Or did you also want me to add a boolean in
diagnostic_context to remember to do that, with a hook to print it, or
what?
The simple change is to add a field in diagnostic_info that stores the
OPT_*, and move the existing if/ACONCAT into diagnostic_report_diagnostic.
Is this what you meant?
Are you thinking that, at some point in the future, we could print a
separate "this option is controlled by ..." line, with print-once
logic for each option? I would argue against that until we can assure
that no two different warnings used the same option, but I can see its
utility at that point.