Open kukrimate opened 3 years ago
Confirmed. I have no idea how this behavior can be useful, but this is indeed a bug in chibicc.
I agree, it's not useful behaviour. I came across it when comparing the output of chibicc to my own implementation of macro expansion and noticed the difference.
Hello,
chibicc does not evaluate the ## operator in the replacement list of an object-like macros.
The C standard says, to quote ISO/IEC 9899:1999:
For example the following:
expands to:
even though the expected expansion by the standard (which gcc and clang conforms to) is:
EDIT: typo