[PATCH] v3 of diagnostic_show_locus and rich_location (was Re: [PATCH 2/5] Reimplement diagnostic_show_locus, introducing rich_location classes (v2))

Manuel López-Ibáñez lopezibanez@gmail.com
Fri Sep 25 20:42:00 GMT 2015

On 25 September 2015 at 22:11, David Malcolm <dmalcolm@redhat.com> wrote:
>> +  if (0)
>> +    show_ruler (context, line_width, m_x_offset);
>> This should probably be removed from the final code to be committed.
> FWIW, the ruler is very helpful to me when debugging the locus-printing
> (e.g. when adding fix-it-hints), and if we remove that if (0) call, we
> get:
> warning: ‘void show_ruler(diagnostic_context*, int, int)’ defined but
> not used [-Wunused-function]
> which will break bootstrap, so perhaps it instead should be an option?
> "-fdiagnostics-show-ruler" or somesuch?
> I don't know that it would be helpful to end-users though.

Functions that are useful only for debugging GCC usually start with
debug_* and have special attribute annotation (grep ^debug_) which
prevents those kinds of warnings (or the optimizers being too smart
and removing them).



More information about the Gcc-patches mailing list