http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57714

--- Comment #14 from David Krauss <potswa at mac dot com> ---
Harald's comment #10 is almost accurate, but for two things:

1. Actually the C standard does care whether whitespace is added. Whitespace is
visible in the result of stringizing, and when comparing duplicate macro
definitions.

2. Whitespace does not need to be added to cause the visual formatting of the
output to match the input. The trick is to output a backslash character in the
output. Of course this would disturb clients who don't expect backslashes in
their pretty-printed output. But pretty-printed output shouldn't be used for
automatic translation in the first place — that is what the -P option is for.

And to reconcile #2 with #1, the stringize operator and macro definition
comparison need to track splices in preserved whitespace, and treat whitespace
composed entirely of splices as nonexistent. That is exactly what I implemented
in my own preprocessor. See edits subsequent to the one linked above.

Such changes must be done internally even if you choose not to print
backslashes to the final output stream. If someone wants to fix this in GCC,
let this be a guide…

Reply via email to