On Wed, 10 Nov 2021, Tobias Burnus wrote:

> Disclaimer: While this patch does a step into the right direction,
> it probably does help with any of the other _Pragma issues. Neither
> with 'gcc -E' when the pragma wasn't registered (still expanded too
> early) nor with the 'GCC diagnostic' issues in general as there the
> input_location is used to decide when to pop - and depending on the
> column numbers, this may or may not work.

And fully correct stringization of _Pragma should respect the spelling of 
the preprocessing tokens (of the string-literal preprocessing token, that 
is; spelling variations for the other preprocessing tokens aren't possible 
here) and the presence or absence of whitespace between them.

_Pragma("foo")
_Pragma ("foo")
_Pragma("foo" )
_Pragma(L"foo")
_Pragma ( "foo" )

(for example) should all have their spelling preserved by stringization 
(but any nonempty white space sequence becomes a single space).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to