...
Code Block | ||||
---|---|---|---|---|
| ||||
int a = 81 / (2 + 1 * 2 + 1 * 2 + 1); /* evaluatesEvaluates to 11 */ |
which is clearly not the desired result.
...
PRE01-EX2: Macro parameters cannot be individually parenthesized when concatenating tokens using the ##
operator, converting macro parameters to strings using the #
operator, or concatenating adjacent string literals. The following JOIN()
macro below concatenates both arguments to form a new token. The SHOW()
macro converts the single argument into a string literal, which is then passed as a parameter to printf()
, and as a string and as a parameter to the %d
specifier. For example, if SHOW()
is is invoked as SHOW(66);
, the macro would be expanded to printf("66" " = %d\n", 66);
.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ECLAIR |
| macrbody | Fully implemented | ||||||
| 78 S | Fully implemented | |||||||
PRQA QA-C |
| 3410 | Fully implemented |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
...