28-04-2016, 09:28 AM
Hi,
strictly interpreted, these rules ban conditional compilation, rendering rules 16-1-1 and 16-1-2 mute.
E.g.:
In addition, there appears to be no such rule in MISRA C 2012 (presumably, because it is a widely used feature in embedded systems):
Rule Mapping to MISRA C 2012
16-0-2 [Required] n.a. but namespaces are not available in C
16-1-1 [Required] n.a.
16-2-1 [Required] n.a.prohibits conditional compilation which is allowed in C
16-2-2 [Required] n.a.prohibits conditional compilation which is allowed in C
I would expect that a feature like the preprocessor, which is equal in C and C++, is treated equally across all MISRA standards.
Is there any chance this will be corrected/clarified in a new version or technical corrigendum?
strictly interpreted, these rules ban conditional compilation, rendering rules 16-1-1 and 16-1-2 mute.
E.g.:
Code:
#ifdef FEATURE_X
// some code
#endif
In addition, there appears to be no such rule in MISRA C 2012 (presumably, because it is a widely used feature in embedded systems):
Rule Mapping to MISRA C 2012
16-0-2 [Required] n.a. but namespaces are not available in C
16-1-1 [Required] n.a.
16-2-1 [Required] n.a.prohibits conditional compilation which is allowed in C
16-2-2 [Required] n.a.prohibits conditional compilation which is allowed in C
I would expect that a feature like the preprocessor, which is equal in C and C++, is treated equally across all MISRA standards.
Is there any chance this will be corrected/clarified in a new version or technical corrigendum?
<t></t>