Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Essential Type of preprocessing statement
#1
Does the essential type system intended to apply to preprocessing expressions?
For example:

Code:
void foo (void)
{
   (0 == 1) + 1;        /* non-compliant with Rule 10.1 */
}

#if (0 == 1) + 1     /* compliant or non-compliant with Rule 10.1 ? */

#endif
Posted by and on behalf of the MISRA C Working Group
Reply
#2
The MISRA guidelines define "code" in the Glossary as
Quote:"Code consists of everything within a translation unit that is not excluded by conditional compilation.
. Therefore, the guidelines apply to code after preprocessing directives have been executed, unless otherwise stated in a guideline.

Therefore "#if (0 == 1) + 1 " is not a violation of rule 10.1
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)