MISRA Discussion Forums
"declaration" in other rules - 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.8 Declarations and defnitions (https://forum.misra.org.uk/forumdisplay.php?fid=163)
+---- Thread: "declaration" in other rules (/showthread.php?tid=1136)



"declaration" in other rules - satoshi - 11-12-2014

Hello

Please teach me the definition of "Declaration" in MISRA-C:2012.

We have read the amplification of rule 8.5.
A member say, "MISRA-C declaration does not include definition, always."
And another member say, "normally, MISRA-C declaration is same as standard-C (include definition)."

We understand that the "Declaration" in Rule 8.5 does not contain "Definition".
In basically, does "Declaration" include "Definition" ?

Best Regards,
Satoshi Kawajiri


Re: "declaration" in other rules - misra-c - 19-12-2014

By default, MISRA C:2012 uses the term "Declaration" to include both defining and non-defining declarations. For example rules 8.3, 8.8, 8.10. It also applies to rule 8.4, though multiple "defining declarations" are banned by rule 8.6.

"Defining declarations" are also referred to as "definitions" in some rules. For example rule 8.6

In the case of rules 8.5 and 8.11 the amplification is used to clarify that the rule only applies to non-defining declarations. An amplification was used in order so that the headline of the rule could be simplified.