On 05/17/2012 05:32 AM, Jason Merrill wrote:
On 05/16/2012 08:34 PM, Paolo Carlini wrote:
Ok. Something like p2 below?

Yes. Since the earlier patch without LOC_OR_HERE passed testing, let's apply that plus this p2.
Ok, great.

Does Manuel's suggestion of aborting if we get UNKNOWN_LOCATION for a diagnostic pass the testsuite?
Right, yesterday forgot to try that, when I came back to this task was a bit tired.

Now, the exercise turned out to be funny, because if I add a gcc_assert (location != UNKNOWN_LOCATION); at the beginning of diagnostic_report_diagnostic the bootstrap fails very early when configuring libgcc because the C compiler is not usable at all. The problem is that the following warning reaches the diagnostic machinery:

(gdb) p *diagnostic
$2 = {message = {format_spec = 0x38138b0 "-Wformat-y2k ignored without -Wformat", args_ptr = 0x7fffffffdaf8, err_no = 2, locus = 0x4fa94a3f, x_data = 0x0}, location = 0, override_column = 0, x_data = 0x0, kind = DK_WARNING, option_index = 226}

now, besides the specific warning - which right now I can't say to fully understand - it looks like we may sometimes try to output stuff which doesn't have to do with a specific line of the user code, thus doesn't come with a location. Can we concisely characterize those messages and exclude them from the gcc_assert?

Thanks,
Paolo.

Reply via email to