Generalized Question about #12.6 and Preprocessor Directives

6.12 Expressions

Moderators: misra-c, david ward

Post Reply
gs
Posts: 87
Joined: Thu Nov 18, 2004 1:39 am

Generalized Question about #12.6 and Preprocessor Directives

Post by gs » Tue Aug 17, 2010 6:39 pm

Was advisory #12.6 intended to apply to preprocessor directives at all? I only ask because the text does not specify one way or the other.

misra-c
Posts: 569
Joined: Thu Jan 05, 2006 1:11 pm

Re: Generalized Question about #12.6 and Preprocessor Direct

Post by misra-c » Fri Aug 20, 2010 9:35 am

While Rule 12.6 doesn't explicitly mention expressions used in preprocessing directlves, it is intended to apply to all expressions.

In considering the question, it seems that there are two omissions from the definition of Boolean expressions in the Glossary (Appendix E), namely:
  • the 'defined' proprocessing operator produces a Boolean-by-construct value
  • a Boolean value is expected as the operand of the #if and #elif directives
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “6.12 Expressions”