Is Rule 20.1 applicable to \"defined\"?

6.20 Standard Libraries

Moderators: misra-c, david ward

Locked
Gavin McCall
Posts: 72
Joined: Mon Sep 13, 2004 9:24 am

Is Rule 20.1 applicable to \"defined\"?

Post by Gavin McCall » Fri Sep 09, 2005 2:30 pm

Question: Is Rule 20.1 applicable to \"defined\"?

(a) We presume that \"#define defined (10)\" will be in violation of Rule 20.1.

(b) If our presumption is correct, then which of \"reserved identifier\", \" macro\" or \"function\" will \"defined\" be?
We could not find the answer in ISO/IEC 9899:1990. Is it described somewhere in COR1, COR2 or AMD1?

Answer: MISRA C Steering Team 7/9/2005

(a) YES - defined is included in the text under the rule.

(b) defined is listed under 6.8.8 Predefined Macro Names.
It is also listed in Appendix G: Undefined Behaviour 54.
Gavin McCall
Personal view only.

Locked

Return to “6.20 Standard Libraries”