02-03-2017, 12:45 PM
MISAR C++ 2008 provides a Glossary entry for 'declaration' with:
This appears to differ from the MISRA C 2012 interpretation. Rule 8.5
includes the text:
According to the MISRA C++ glossary entry, the use of "once" in the headline
text is redundant, as any additional declarations are "re-declarations".
Is the MISRA C meaning intended to be different to that of MISRA C++ 2008?
If so, could you provide an example where it is dangerous to use re-declarations?
Quote: For the purposes of this standard, in headline rule text a
declaration is the first introduction of a name into a translation
unit. All subsequent “declarations†(as per ISO/IEC 14882:2003 [1]
§3.2(1)) are re-declarations.
This appears to differ from the MISRA C 2012 interpretation. Rule 8.5
includes the text:
Quote:... shall be declared once in one and only one file.
According to the MISRA C++ glossary entry, the use of "once" in the headline
text is redundant, as any additional declarations are "re-declarations".
Is the MISRA C meaning intended to be different to that of MISRA C++ 2008?
If so, could you provide an example where it is dangerous to use re-declarations?
<t></t>