MISRA Discussion Forums
Rule 19.10 - 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.19 Preprocessing Directives (https://forum.misra.org.uk/forumdisplay.php?fid=43)
+---- Thread: Rule 19.10 (/showthread.php?tid=948)



Rule 19.10 - Tobias Gradl - 12-03-2013

I have a violation in MISRA 2004 rule 19.10:
unparenthesized macro parameter in definition of macro: '__identifier'
and a violation in MISRA 2004 rule 19.4:
disallowed definition for macro '__identifier'

but i don't have a macro '__identifier' in my sourcecode.

Does MISRA 2004 allow include-blockers like
Code:
#ifndef EXAMPLE_H
#define EXAMPLE_H
...
#endif
or not? I assume that this may cause the errors above.

Best Regards
Tobias Gradl


Re: Rule 19.10 - misra-c - 13-03-2013

Although your source code doesn't contain a macro '__identifier', perhaps there is a definition of this macro in one of the header files that is included by your code?

It is also possible that the checking tool that you are using has made a mistake or is using '__identifier' as a generic term for an identifier that begins '__' but t is difficult to comment fully without seeing the source code.

Yes, MISRA C:2004 does permit "include-blockers." See Rule 19.15 for an example.