On 07/29/2016 03:42 PM, Joseph Myers wrote:
On Tue, 26 Jul 2016, David Malcolm wrote:

This patch implements precise tracking of source locations for the
individual chars within string literals, so that we can e.g. underline
specific ranges in -Wformat diagnostics.  It handles macros,
concatenated tokens, escaped characters etc.

What if the string literal results from stringizing other tokens (which
might have arisen in turn from macro expansion, including expansion of
built-in macros not just those defined in source files, etc.)?  "You don't
get precise locations" would be a fine answer for such cases - provided
there is good testsuite coverage of them to show they don't crash the
compiler or underline nonsensical characters.
I think losing precise locations in some circumstances would be fine as well -- as long as we understand the limitations.

And, yes, crashing or underlining nonsensical characters would be bad, so it'd be obviously good to test some of that to ensure the fallbacks work as expected.

jeff

Reply via email to