Message ID | 4FB447AD.2060308@oracle.com |
---|---|
State | New |
Headers | show |
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.
Does Manuel's suggestion of aborting if we get UNKNOWN_LOCATION for a
diagnostic pass the testsuite?
Jason
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.
On 05/17/2012 09:48 AM, Paolo Carlini wrote: > Can we concisely characterize those messages and exclude them from the > gcc_assert? Well, if don't quickly figure out something better, I guess we can always add the assert at the beginning of warning_at, error_at, etc. Paolo.
On Thu, May 17, 2012 at 2:52 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote: > On 05/17/2012 09:48 AM, Paolo Carlini wrote: >> >> Can we concisely characterize those messages and exclude them from the >> gcc_assert? > > Well, if don't quickly figure out something better, I guess we can always > add the assert at the beginning of warning_at, error_at, etc. I am still puzzled by why we need to assert, as opposed to just ignore, unless we have a plan to make a wholesale move -- but even there I am bit nervous. -- Gaby
Index: diagnostic.c =================================================================== --- diagnostic.c (revision 187588) +++ diagnostic.c (working copy) @@ -508,6 +508,13 @@ diagnostic_report_diagnostic (diagnostic_context * diagnostic_t orig_diag_kind = diagnostic->kind; const char *saved_format_spec; + /* Tolerate UNKNOWN_LOCATION and turn it to input_location. */ + if (location == UNKNOWN_LOCATION) + { + diagnostic->location = input_location; + location = input_location; + } + /* Give preference to being able to inhibit warnings, before they get reclassified to something else. */ if ((diagnostic->kind == DK_WARNING || diagnostic->kind == DK_PEDWARN)