MISRA Discussion Forums

Full Version: "declaration" in other rules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.