HP Code Advisor Diagnostics Reference Guide (5900-1865, July 2011)

foo(10);
}
Action:
Declare the function before it is referenced.
Reference:
C99 6.5.2.2
2.36 2224 the format string requires additional arguments
Cause:
The number of conversion specifiers is more than the number of values to be converted as specified
in the parameter list.
Example:printf("%d %d", 2);
Action:
Make sure the number of conversion specifiers match the number of values to be converted.
Reference:
2.37 2225 the format string ends before this argument
Cause:
The number of conversion specifiers is less than the number of values to be converted as specified
in the parameter list.
Example: printf("%d ", 2, 2);
Action:
Make sure the number of conversion specifiers match the values to be converted.
Reference:
2.38 2226 invalid format string conversion
Cause:
The compiler has detected an ill formed conversion specification (flags, width, precision, length
modifier) or an unknown conversion specifier (not diouxefgcspn...) that will cause unpredictable
behavior.
Example: printf("%z ", 2);
Action:
Review the documentation for this function and modify the conversion specification as appropriate.
Reference:
2.39 2228 trailing comma is nonstandard
Cause:
Accepting an enumerator list that contains a trailing comma is an extension of HP C provided for
compatibility with other C compilers. An enumerator list with a trailing comma is not valid in C89,
nor in C++.The C99 standard does permit this syntax.
Example:
typedef enum Switch {
on,
off,
} var;
Action:
34 Diagnostics Details