Notion of unused parameter in 0-1-11 and 0-1-12

Moderators: david ward, misra cpp

Post Reply
roberto
Posts: 11
Joined: Wed Jun 04, 2008 10:33 pm
Company: University of Parma, Italy

Notion of unused parameter in 0-1-11 and 0-1-12

Post by roberto » Sun Jul 25, 2010 3:58 pm

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?

misra cpp
Posts: 148
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Notion of unused parameter in 0-1-11 and 0-1-12

Post by misra cpp » Mon Oct 05, 2015 2:23 pm

'a' is used – see the definition of “used” in the Glossary of MISRA C++:2008:
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

Post Reply

Return to “6.0 Language independent issues (C++)”