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

Table Of Contents
Reference:
C99 6.7.2.2 ANSI/ISO C++ 7.2
2231 declaration is not visible outside of function
Cause:
A type is declared within a function prototype. The type is local to the function prototype and will
not be visible outside the prototype. This might cause unexpected errors later in the compilation.
Example: void foo(struct X { int i; } );
Action:
Declare the type before the function prototype.
Reference:
2236 controlling expression is constant
Cause:
A boolean controlling expression tests for a constant pointer or pointer to member values. NOTE:
This warning is not issued for cases like if (1) ; since these often result from valid macro expansions.
Example:
void foo();
int main() {
if (foo) { // warning 2236 here.
}
}
}
Action:
A test of a constant address is unusual, and might be done by mistake - check if this is what you
intended.
Reference:
2237 selector expression is constant
Cause:
The given expression in the controlling expression of a switch statement is a constant. Switch
statements are usually used for variables to choose between various alternatives at runtime.
Example:
int main() {
switch(10) {
case 10: printf("ten\n"); break;
case 20: printf("twenty\n"); break;
default: printf("error\n");
}
}
}
Action:
Check if it is a programming error.
Reference:
2245 a nonstatic member reference must be relative to a specific object
Cause:
Only static members can be accessed using the class name. For accessing non-static members,
specific object must be used.
2231 declaration is not visible outside of function 35