![]() |
![]() |
3113 | ![]() |
||||
![]() | |||||||
| Explicitly undefined | REFERENCE - ISO:C90-6.6.6.4 The return Statement - Semantics | ||||||
This return statement has no return expression. However, the function has actually been defined without an explicit return type and so the C language assumes a return type of int. Omitting to specify an explicit type when declaring either a function or an object is not recommended. Messages 2050 or 2051 will be generated. If it is really intended that this function should not return a value, amend the definition so that the return type is explicitly declared as void. For example:
/*PRQA S 2017,2201,3408 ++*/
extern f1(void) { /* Message 2050 */
return 1;
}
extern f2(void) { /* Message 2050 */
return; /* Message 3113 */
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |