Closed graphitemaster closed 10 years ago
The behaviour is consistent with fteqcc, however I'd gladly add C behavior as an option! (Switching this from E-Bug to C-Proposal)
Yes, for Xonotic I would actually want to set it up to have the C-like behaviour instead.
-fftepp vs -fcpp ;)
divVerent, the -fcpp behavior would most likely disable recursive macro definitions since those are not allowed in traditional cpp :P
Doesn't have to...
It's common behavior that that the following would work in terms of cpp behavior:
With ftepp
THE_ANSWER_STR
results in the following string:"THE_ANSWER"
To figure out the exact expected behavior of macro substitution I looked in the C standard documentation to find this golden gem:This sounds confusing due to the way ANSI tried to redact their documents, essentially (it means):
when we use:
STR1(THE_ANSWER)
we should get"THE_ANSWER"
, because the argument ofSTR1
is not macro-expanded. However, the argument of STR2 is macro-expanded when it's substituted into the definition ofSTR2
, which therefore givesSTR1
an argument of 42, with the result of"42"
.I suspect there is some code that heavily requires this behavior (that didn't surface because valid strings were still generated, albeit semantically generated wrong)