HP Code Advisor Diagnostics

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.
Example:int foo(arg) { return arg; }
Action:
Declare the parameter. Preferable old-style function definitions should be replaced by
prototype-format definitions.
Reference:
C99 6.9.1
3055 types cannot be declared in anonymous unions
Cause:
Anonynous unions can only define non-static data members. You cannot declare types or functions
within anonymous unions.
Example:
static union {
typedef int T;
T i;
};
Action:
Remove the typedef from the anonymous union. Either declare the members without the typedef
type or provide the typedef outside the anonymous union. For example: static union { int i; };
Reference:
ANSI/ISO C++ 9.5(2)
3056 returning pointer to local variable
Cause:
52 Diagnostics Details