Clarification of 20.1 Scope - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4) +--- Forum: MISRA-C: 2004 rules (https://forum.misra.org.uk/forumdisplay.php?fid=17) +---- Forum: 6.20 Standard Libraries (https://forum.misra.org.uk/forumdisplay.php?fid=42) +---- Thread: Clarification of 20.1 Scope (/showthread.php?tid=37) |
Clarification of 20.1 Scope - Gavin McCall - 09-09-2005 Question: Question 1: Interpretation of \"Reserved identifiers, macros and functions in the standard library\" Does this phrase mean a) \"Reserved identifiers AND macros in the standard library AND functions in the standard library\" or b) \"Reserved identifiers in the standard library AND macros in the standard library AND functions in the standard library\" ? It seems that in case of a) above, \"#define __ABC (10)\" violates Rule 20.1 whereas it does not in case of b), because \"__ABC\", which is a reserved identifier, is not in the standard library. Moreover, it is not guaranteed that all of \"__LINE__, __FILE__, __DATE__, __TIME__, __STDC__ \" are in the standard library. If not in the standard library, it is presumed that they can be \"defined, redefined or undefined\". Which interpretation should we take, a) or b) ? MISRA C Steering Team Answer (7/9/2005) Option A. Reserved identifiers are defined by ISO/IEC 9899:1990 sections 7.1.3 Reserved Identifiers, 7.13 Future library directions and 6.8.8 Predefined Macro Names. Macros in the standard library are examples of reserved identifiers. Functions in the standard library are examples of reserved identifiers. Any identifier in the standard library is an example of reserved identifiers. |