On 15/09/15 10:32, Mark Wielaard wrote:
On Mon, 2015-09-14 at 21:37 -0600, Martin Sebor wrote: Although I now notice they differ on the placement of the carrot. Maybe the location passed into the warning is not correct/ideal?
The caret is placed at the location given by expand_location(loc), with loc being the location passed to warning_at(). As far as I am aware, there are no bugs on that. If the caret is wrong, it is definitely because the location passed is the wrong one. You need to find the correct one (which may appear up in the call stack and may need to be passed down) and pass that one instead.
You can test the location with { dg-warning "18:nonnull argument" } where 18 is the column number expected. I wish it was used more frequently, in particular in those cases where we have the perfect location and it would be pity to regress.
Cheers, Manuel.