This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 01/02] PR/62314: add ability to add fixit-hints
- From: Jeff Law <law at redhat dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Nov 2015 13:03:24 -0700
- Subject: Re: [PATCH 01/02] PR/62314: add ability to add fixit-hints
- Authentication-results: sourceware.org; auth=none
- References: <1447173325-48683-1-git-send-email-dmalcolm at redhat dot com> <564CF44F dot 4010204 at redhat dot com> <1447885546 dot 19594 dot 117 dot camel at surprise>
On 11/18/2015 03:25 PM, David Malcolm wrote:
What is the purpose of the #if 0 code in the various tests? Did you
mean to leave those in?
Presumably you're referring to the bodies of the functions
test_fixit_insert
test_fixit_remove
test_fixit_replace
within:
gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-bw.c
gcc/testsuite/gcc.dg/plugin/diagnostic-test-show-locus-color.c
where the bodies are purely of the form:
{
#if 0
some code, containing dejagnu directives.
#endif
}
Yes. Those are the ones I'm referring to, I should have been more explicit.
Although this looks weird, it's deliberate, and follows the pattern
earlier in those test files: the diagnostics are injected by the plugin,
not by cc1. The plugin gives us a way of unit-testing how
diagnostic_show_locus handles the various ways of calling into the
diagnostic API, isolating it from the details of any particular real
diagnostic in cc1, and from the details of how to get real
location/range information.
*must* *remember* *this* *stuff* *is* *different*.
So essentially the code is there to mimick, to some degree, what we're
going to warn for via the diagnostic API. The code itself isn't of any
real interest other than, essentially, documenting roughly what kidn of
code we'd be warning about.
*must* *remember* *this* *stuff* *is* *different* :-)
Does the above address your concerns? (Joesph already approved the
other patch)
Yes. This is good to go into the trunk.
jeff