This is the mail archive of the
mailing list for the GCC project.
Re: [warnings] tagging warnings about options themselves
email@example.com (DJ Delorie) wrote on 25.07.05 in <200507251814.j6PIELVQ018017@greed.delorie.com>:
> A thought occurs to me: we could make warning() a macro that passes
> __FILE__ and __LINE__ to the diagnostic machinery, and if there's no
> OPT_ value it can make one up from the file/line (like
> -Wc_common_c_456). The only time the user would *ever* see this is if
> they used -fdiagnostics-show-option, and we could emit a note the
> first time they see one of these that says it's version-specific. It
> would be useful to developers too, especially when we've got lots of
> same-wording diagnostics all over the place.
> It would probably mess up the "unknown -W option" logic though.
I'd prefer a slightly different version - have a -fwarning-source or so
option to tag that info onto every warning. That way you can easily locate
where the particular warning came from. Only useful if you have source, of
course, and if you can read C, but there are enough people for whom that
works or can easily be made to work.
On one or two occasions, using the source was the only way for me to
understand a warning. (Or was that an error? Same logic applies there.)