Rule 2.1 has an Exception.

Moderators: misra-c, david ward

Post Reply
ogawa.kiyoshi
Posts: 15
Joined: Fri May 27, 2005 10:08 am
Company: NMIRI, Gifu-University, TOPPERS project
Location: Japan

Rule 2.1 has an Exception.

Post by ogawa.kiyoshi » Mon Jan 13, 2014 12:20 pm

In rule 2.1, Note: "code that has been conditionally excluded by pre-processor directives is not subject to this rule as it is not presented to the later phases of translation.". I think this statement may be "Exception". Do you think so?
Dr. OGAWA Kioshi
@kaizen_nagoya

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

Re: Rule 2.1 has an Exception.

Post by misra-c » Thu Jan 16, 2014 12:43 pm

The MISRA C:2012 guidelines define “code” in the Glossary as
Code consists of everything within a translation unit that is not excluded by conditional compilation
Therefore, all guidelines apply to code after preprocessing directives have been executed, unless otherwise stated in a guideline.

This includes rule 2.1, and the note has only been added to clarify the situation for the user who may not be aware of the definition in the glossary.
---
Posted by and on behalf of
the MISRA C Working Group

Post Reply

Return to “8.2 Unused code”