Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Notion of unused parameter in 0-1-11 and 0-1-12
#1
Suppose `a' is a parameter. Does `sizeof(a)' count as a use of `a' for the purpose of compliance to 0-1-11 and 0-1-12?
<t></t>
Reply
#2
'a' is used – see the definition of “used” in the Glossary of MISRA C++:2008:

Quote:An object is used if it is:
  • The subject of a cast;
  • Explicitly initialized at declaration time;
  • An operand in an expression;
  • Referenced.

In this case, 'a' is used as an operand in an expression.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)