[PATCH 01/02] PR/62314: add ability to add fixit-hints

Jeff Law law@redhat.com
Tue Nov 24 20:04:00 GMT 2015


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



More information about the Gcc-patches mailing list