[patch] remove in_system_header variable and fields

Manuel López-Ibáñez lopezibanez@gmail.com
Thu Jul 17 13:50:00 GMT 2008


2008/7/17 Rafael Espindola <espindola@google.com>:
>> Actually, we don't need to do that. You can just use:
>>
>> warning_at (location, OPT_Wreturn_type, "control reaches end of
>> non-void function");
>>
>> and it should work. Doesn't it?
>
> I would have to update warning_at to add the %H and the &location
> argument, but should be possible.

I don't understand the above. The output of

>> warning_at (location, OPT_Wreturn_type, "control reaches end of
>> non-void function");

should be the same as:

warning (location, OPT_Wreturn_type, "%Hcontrol reaches end of
non-void function", &location);

when %H is missing, the diagnostic machinery takes the location stored
in diagnostic->location, which for warning is input_location but for
warning_at is the location parameter.

> I am not sure if there is any
> warning that would need to used warning_at but would like to not have
> the location printed.

I don't understand this sentence either. All warnings have a location
printed. If it is explicit by using %H, %J or %K, then you can always
replace it by warning_at (location) or warning_at(DECL_SOURCE_LOCATION
(t)) or warning_at(EXPR_LOCATION (t)). Otherwise warning prints
input_location and you can always use warning_at (input_location)
which will have the same effect as warning() without any %H, %J or %K
modifiers. Am I missing something here?

Cheers,

Manuel.



More information about the Gcc-patches mailing list