HP-UX Cadvise Diagnostics Reference Guide (5900-1865, August 2012)

Table Of Contents
2940 missing return statement at end of non-void function "function"
Cause:
A function with an explicit return type does not contain a return statement.
Example:int foo() { }
Action:
If the function is supposed to return a value, add a return statement with appropriate value, otherwise
declare the return type as void.
Reference:
2951 return type of function "main" must be int
Cause:
Standard C requires that the return type of "main" function must int. In case of non int return type
the status value returned to the environment may not be what you expect. Also, this code is not
portable.
Example:long main() { }
Action:
Define the "main" function with a return type of int for maximal portability.
Reference:
C99 5.1.2.2.1
2991 extra braces are nonstandard
Cause:
An initializer contains extra open or close braces for the object being initialized.
Example:int arr [4] = { { 0 } };
Action:
Remove extra braces.
Reference:
3000 a storage class may not be specified here
Cause:
A storage class can only be specified for an object or a function.
Example:static enum nothing { nil = 0 };
Action:
Remove the unnecessary storage class specifier.
Reference:
ARM 7.1.1.
3051 standard requires that %n be given a type by a subsequent
declaration (\"int\" assumed)
Cause:
The parameter of an old-style function definition was not declared. It will default to int type. Omitting
the type specifier is not valid in C99.
48 Diagnostics Details