HP Code Advisor Diagnostics Reference Guide (5900-1865, July 2011)
Example:
int foo(int x);
int main() {
int foo(); // warning 3197 here
}
Action:
Remove the unprototyped declaration.
Reference:
2.96 3290 Passing a non-POD object to a function with variable arguments
has undefined behavior. Object will be copied onto the stack instead of
using a constructor.
Cause:
A non-POD (POD stands for "plain old data") object is being passed to a function with variable
arguments. Object will be copied onto the stack instead of using a constructor.Varargs do not
know how to deal with non-POD types, this can lead to undefined behavior.
Example:
class A {
int i;
};
int foo(char*, ...);
int bar() {
A a;
foo("hello",a);
return 0;
}
Action:
Do not pass non-POD object to a function with variable arguments. If this is essential write a
conversion operator to convert from non-POD to POD type and call that operator before passing
the object to the variable arguments function.
Reference:
2.97 3348 declaration hides %nd
Cause:
A declaration hides another variable with the same name visible in this scope.
Example:
struct X {
X(int i) {
i = i;
}
int i;
};
Action:
Examine your code to see if any of the two declarations should be removed/modified.
Reference:
2.96 3290 Passing a non-POD object to a function with variable arguments has undefined behavior. Object will be copied
onto the stack instead of using a constructor.
51