20.1, 20.2 scopes

6.20 Standard Libraries

Moderators: misra-c, david ward

Locked
pkruk
Posts: 20
Joined: Fri Jul 27, 2007 3:25 pm

20.1, 20.2 scopes

Post by pkruk » Thu May 15, 2008 2:08 pm

Is rule 20.1 limited to #define and #undef directives?
Is rule 20.2 limited only to identifiers already defined in standard library?

If this is true:

Code: Select all

void errno(); 
/* errono is a reserved keyword and is already defined in standard library */
/* This code is a violation of rule 20.2 only  */

int __MyVariable(); 
/* __MyVariable is also a reserved keyword but is not defined in standard library */
/* This code is not a violation of 20.1 nor 20.2 */ 

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

Re: 20.1, 20.2 scopes

Post by misra-c » Tue May 20, 2008 5:08 pm

Is rule 20.1 limited to #define and #undef directives?
This is limited to #define and #undef.
Is rule 20.2 limited only to identifiers already defined in standard library?
The intent is that Rule 20.2 applies to both current library identifiers and all reserved identifiers. This includes all identifiers which begin with the underscore character. This will be clarified in the next version of MISRA-C.
---
Posted by and on behalf of
the MISRA C Working Group

Locked

Return to “6.20 Standard Libraries”