HP Code Advisor Diagnostics

Action:
Do not return reference to a local variable; if you really want to return a reference, make the local
variable static. This is because the lifetime of a static variable is same as lifetime of the program.
Reference:
2837 omission of explicit type is nonstandard ("int" assumed)
Cause:
A declaration or a definition does not have an explicit type, int will be assumed as the type but
this behavior is non-standard.
Example:
extern i;
a();
b(){}
extern c();
extern d(){}
Action:
Add an explicit type for the declaration or definition.
Reference:
C99 6.7.2(2), ANSI/ISO C++ 7.1.5(2)
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.
2837 omission of explicit type is nonstandard ("int" assumed) 51