HP Code Advisor Diagnostics

2 Diagnostics Details
This chapter provides the detailed description for a subset of diagnostics emitted by HP Code
Advisor.
2009 nested comment is not allowed
Cause:
Opening comment delimiter, /*, found inside delimited comment. A previous comment may be
missing its closing delimiter. C comments delimited by /* */ do not nest.
Example:
/* comment1 // missing */ for comment1
/* comment2 // warning 2009 here
*/
Action:
Check if a previous comment is missing its terminating */ or if you are attempting to "comment
out" a section of code that contains a delimited comment.
Reference:
C99 6.4.9, ANSI/ISO C++ 2.7(1)
2028 expression must have a constant value
Cause:
In many cases, initializations need to be constant expressions. This diagnostic is emitted if the
initialization expression is not a constant expression.
Example:
// error in C-mode
void foo() {
int i = 10;
static int j = i;
}
Action:
Provide constant expressions for initialization.
Reference:
C99 6.6
2042 operand types are incompatible (%t1 and %t2)
Cause:
Operation might be invalid due to incompatible operand types.
Example:
#define DT 10
typedef char* caddr;
int main() {
caddr data = "0x1";
if (data == DT)
return 1;
}
2009 nested comment is not allowed 27