6.19 Preprocessing Directives
Moderators: misra-c, david ward
- Posts: 53
- Joined: Mon Dec 06, 2004 12:24 pm
This macro breaks rule 19.4. Macro expanding to Null statement is not allowed/
Code: Select all
#define M3 /* comment */
This macro expands to no body, and is therefore not prohibited by 19.4.
A comment in a macro definition is removed by the pre-processor. Rule 14.3 applied before
Pre-processing. Treatment of M2 and M3 is identical.
Since definition of M1 macro was invalid, its use is already a violation.
After pre-processing, these are both Null statements. Before pre-processing, there are characters before the Null statement. This is not allowed by 14.3.