This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Make all usage of "input_location" be explicit
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, David Malcolm <dmalcolm at redhat dot com>
- Date: Tue, 2 Jul 2013 22:29:30 +0200
- Subject: Re: [PATCH] Make all usage of "input_location" be explicit
> Echoing Tom's question: given that last 2011 commit for improved macro
> diagnostics which appears to assume a diagnostic->location, is it
> reasonable to expect every call to diagnostic_report_current_function
> call to have the right filename for diagnostic->location for the lang
Not only that, but I predict that if there are cases where
input_filename is different from the filename implied by
diagnostic->location, then the output will be wrong, because the
filename reported before the prefix "warning:", "error:" and others is
taken from diagnostic->location. So the filename given by
diagnostic_report_current_function will be different than the one
reported in the prefix.
I don't think the testsuite currently checks this, but you could add
an assert, bootstrap and run the testsuite and see if it breaks. My
guess is that if it breaks, it will turn out to be a bug.