[previous] 3114 [next] [U] Function '%s()' is implicitly of type 'int' but ends without returning a value.
Explicitly undefined REFERENCE - ISO:C90-6.6.6.4 The return Statement - Semantics

This function terminates without a return statement. 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 1-9999 ++*/
/*PRQA S 2050, 2888, 3114 --*/

extern f1(void) {               /* Message 2050 */
    /* ... */
    return 1;
}

extern f2(void) {               /* Message 2050 and 2888 */
    /* ... */
}                               /* Message 3114 */


extern int f3(void) {           /* Message 2888 */
    /* ... */
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents