saltwater
saltwater copied to clipboard
The order of preprocessor stringifying is wrong.
Stringify should be applied before doing replacement on the function parameters, but that replacement should occur before passing them to deeper functions (I think). I expect this has been broken since #456 but I will dig deeper.
Sample Code
#define str(a) # a
#define xstr(a) str(a)
#define f(x) [x]
str(f(5))
xstr(f(5))
Expected Behavior
"f(5)"
"[5]"
Actual Behavior
"f(5)"
"f(5)"
Confirmed: this originated in #456 (specifically commit 3d2d038 but it didn't compile from 34e5ad2..8ef29cf and stringify was not implemented in ..0ef39e4).