Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
winocm
· 1y ago · 0 comments
Mildly related, sort of, one can prevent expansion of variadic macros as follows:
#define printf(...) int (printf)(const char *, ...);
I keep on seeing many random code bases just resort to #undef instead...
Comments
[–]
pwdisswordfishy
1y ago
Doesn't this trigger warnings?
[–]
joriatsy
1y ago
Function like macros literally requires name( , i.e name followed directly by open paren, otherwise no macro substitution occurs. so (name)() will always suppress function like macros (but
not
non-function ones, i.e regular #define name xxx)