Reputation: 1466
From the C11 Standard Draft N1570, §6.4/3:
[...] The categories of preprocessing tokens are: header names, identifiers, preprocessing numbers, character constants, string literals, punctuators, and single non-white-space characters that do not lexically match the other preprocessing token categories.69) If a ' or a " character matches the last category, the behavior is undefined. [...]
69) An additional category, placemarkers, is used internally in translation phase 4 (see 6.10.3.3); it cannot occur in source files.
(Emphasis mine.)
I cannot find a valid way to code a program containing a valid preprocessing token "
.
Upvotes: 1
Views: 206
Reputation: 241721
The text you highlighted says that if a ' or " is used in such a way that it would be a single non-whitespace character preprocessing token, then the program is invalid (i.e. "the behaviour is undefined"). So no self-respecting compiler will allow you do do that; compilers certainly don't have any obligation to do anything you might consider sensible with explicitly undefined behaviour.
Upvotes: 2