Definition of "declare" for Rule 21.2 - 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:2012 and MISRA C:2023 guidelines (https://forum.misra.org.uk/forumdisplay.php?fid=21) +---- Forum: 8.21 Standard libraries (https://forum.misra.org.uk/forumdisplay.php?fid=176) +---- Thread: Definition of "declare" for Rule 21.2 (/showthread.php?tid=1051) |
Definition of "declare" for Rule 21.2 - satoshi - 17-04-2014 Rule's title say "shall not be declared." C90/C99 use the "declare" for function declarations and variable declarations. And, macros are used the "define". Quote:p.167 "example" is a rule violation for the macro definition. To error the macro definitions could not be a role of rule 21.1? ----- Best regards, Satoshi Kawajiri Re: Definition of "declare" for Rule 21.2 - misra-c - 20-05-2014 Rule 21.1 restricts the use of #define and #undef on certain names. Rule 21.2 restricts the declarations of certain names. As you found, we have incorrectly put an example in the incorrect rule. Code: #define _BUILTIN_sqrt(x) (x) /* Non-compliant with Rule 21.1, but compliant with Rule 21.2 */ Thank you for pointing this out to us. |