...
Code Block |
---|
#define JOIN(a, b) (a ## b) #define SHOW(a) printf(#a "" = %d\n"", a) |
See PRE05-C. Understand macro replacement when concatenating tokens or performing stringification for more information on using the ##
operator to concatenate tokens.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Other Languages
This rule appears in the C++ Secure Coding Standard as PRE01-CPP. Use parentheses within macros around parameter names.
References
Wiki Markup |
---|
\[[ISO/IEC 9899:1999|AA. C References#ISO/IEC 9899-1999]\] Section 6.10, ""Preprocessing directives,"" and Section 5.1.1, ""Translation environment"" \[[ISO/IEC PDTR 24772|AA. C References#ISO/IEC PDTR 24772]\] ""JCW Operator precedence/Order of Evaluation"" \[[MISRA 04|AA. C References#MISRA 04]\] Rule 19.1 \[[Plum 85|AA. C References#Plum 85]\] \[[Summit 05|AA. C References#Summit 05]\] Question 10.1 |
...
01. Preprocessor (PRE)