/* >>>------------------------------------------------------------ * * File: rule_14.3.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 14.3 (Required): * Before preprocessing, a null statement shall only occur on a * line by itself; it may be followed by a comment provided that the * first character following the null statement is a white-space * character. * * Implemented by message: * 3138 Null statement is located close to other code or * comments. * * <<<------------------------------------------------------------ */ /* PRQA S 2982 ++ */ #include "misra.h" #include "m2cmex.h" #define BRACES {} /* MISRA Violation Rule 19.4 */ #define SCOLON ; /* MISRA Violation Rule 19.4 */ extern S16 test_1403( void ) { S16 i; /* The following null statements violate Rule 14.3 */ ;i = 1; i = 1;; {}; ;/* ... */ /* ... */; /* ... */ ; ;// if (s16a == 1); if (s16a == 2) /* ... */ ; for (i = 0; i < s16b; ++i); ;for (i = 0; i < s16b; ++i) ;BRACES BRACES; BRACES; /* ... */ ;SCOLON /* ... */; ;/* ... */ /* A Comment */ ; /* Not compliant, comment before semi-colon */ ;/* Not compliant, no white-space char after semi-colon */ /* The following null statements comply with Rule 14.3 */ ; ; /* Compliant */ ; /* ... */ return 1; }