![]() |
![]() |
3209 | ![]() |
||||
![]() | |||||||
| Functions | REFERENCE - ISO:C90-6.6.6.4 The return Statement | ||||||
This function has been declared with a "non-void" return type but the value returned is always ignored. If a function returns a value, it is usually intended that the value should be used in some way. If it is really intended that a return value should be ignored, it is conventional to cast it to "void". For example:
/*PRQA S 2017,3198,3408,3447 ++ */
extern int f1(void); /* Message 3209 */
extern int f2(void); /* Message 3208 */
extern int f3(void); /* No message */
extern int f4(void); /* No message */
extern int foo(void)
{
int r;
f1(); /* Message 3200 */
f2(); /* Message 3200 */
r = f2();
(void)f3(); /* No message */
(void)f4(); /* No message */
r = f2();
return r;
}
See also:
![]() | ||
| QA·C Source Code Analyser 8.1.2
© 2013 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | Contents |