![]() |
![]() |
3007 | ![]() |
||||
![]() | |||||||
| Functions | REFERENCE - ISO:C90-6.5.4.3 Function Declarators (Including Prototypes) - Semantics, ISO:C90-6.7.1 Function Definitions - Constraints | ||||||
A function is being defined with an empty parameter-list. Functions can be defined with no parameters using either an empty parameter-list or a list consisting of the single keyword "void". There is no semantic difference and the choice is a matter of style. However, when declaring a function with no parameters, the use of "void" is important.
/*PRQA S 1303,2017,3408 ++*/
extern int f1()
{ /* Message 3007 */
return 1;
}
extern int f2(void)
{
return 1;
}
MISRA C:2012 Rules applicable to message 3007:
| Rule-8.2 (Required) | Function types shall be in prototype form with named parameters |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |