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

Table Of Contents
Action:
#warning directives are usually added to warn against fallthrus in conditionally compiled code.
check if you need to handle a new condition.
Reference:
3138 format argument does not have string type
Cause:
The format argument of a function having same attributes as the printf, scanf family functions must
be of string type.
Example:
int print(char *str,void *fmt, ...)
__attribute__((format(printf,2,3))); // argument 2 must be of
// string type
Action:
Change the type of format argument to string type
Reference:
3145 %t1 would have been promoted to %t2 when passed through the
ellipsis parameter; use the latter type instead
Cause:
Arguments that are passed as variable arguments are subjected to default argument promotion.
The programmer should be aware of such promotions and should ensure that they do not effect
the correctness of the program.
Example:
int print(char *str,void *fmt, ...)
__attribute__((format(printf,2,3))); // argument 2 must be of
// string type
Action:
Where possible use the promoted type instead
Reference:
ANSI/ISO C++ 5.2.2(7)
3197 the prototype declaration of %nfd is ignored after this unprototyped
redeclaration
Cause:
The unprototyped declaration of a function in an inner scope hides an prototyped declaration in
the outer scope. NOTE: In same scope the function prototypes do not hide each other but in nested
scope they do.
Example:
int foo(int x);
int main() {
int foo(); // warning 3197 here
}
Action:
Remove the unprototyped declaration.
Reference:
50 Diagnostics Details