[previous] MISRA-C:2004  Rule  16.5:  (Required) [next] Functions with no parameters shall be declared and defined with the parameter list void.
Functions shall be declared with a return type (see Rule ), that type being void if the function does not return any data. Similarly, if the function has no parameters, the parameter list shall be declared as void. Thus for example, a function, myfunc, which neither takes parameters nor returns a value would be declared as:

void myfunc( void );


QAC messages that encompass this guideline:

3001 Function has been declared with an empty parameter list.
3007 "void" has been omitted when defining a function with no parameters.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents