MISRA Discussion Forums
Notion of unused parameter in 0-1-11 and 0-1-12 - Printable Version

+- MISRA Discussion Forums (https://forum.misra.org.uk)
+-- Forum: MISRA C++ (https://forum.misra.org.uk/forumdisplay.php?fid=18)
+--- Forum: MISRA C++:2008 rules (https://forum.misra.org.uk/forumdisplay.php?fid=19)
+---- Forum: 6.0 Language independent issues (C++) (https://forum.misra.org.uk/forumdisplay.php?fid=129)
+---- Thread: Notion of unused parameter in 0-1-11 and 0-1-12 (/showthread.php?tid=759)



Notion of unused parameter in 0-1-11 and 0-1-12 - roberto - 25-07-2010

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?


Re: Notion of unused parameter in 0-1-11 and 0-1-12 - misra cpp - 05-10-2015

'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.