HP Code Advisor Diagnostics

Reference:
2064 declaration does not declare anything
Cause:
The declaration does not declare anything. The C standard requires that a declaration must
declare at least a tag, an enumeration constant or a declarator.
Example:
int;
Action:
Correct or remove the declaration.
Reference:
C99 6.7.2, ANSI/ISO C++ 6.7(2)
2068 integer conversion resulted in a change of sign
Cause:
Conversion of integer resulted in sign change. Either an unsigned 1-bit bitfield was assigned -1,
or a signed 1-bit bitfield was assigned 1.
Example:
#define NEGATIVE (-1)
int main() {
unsigned int a = NEGATIVE;
}
Action:
Conversion from a signed int to unsigned leads to change of sign. This might result in an
unexpected behavior of the code. If the sign of the integer is not a concern, then this diagnostic
can be ignored. Otherwise, do not assign a signed value to unsigned type and vice versa.
Reference:
2069 integer conversion resulted in truncation
Cause:
Conversion of integer resulted in truncation. This causes loss of some digits.
Example:
#define FCD_NEGATIVE 390000000
int main() {
short int a = FCD_NEGATIVE;
}
Action:
Conversion from a larger integral type to a smaller integral type leads to truncation. This might
result in an unexpected behavior of the code. Hence, avoid doing such conversions.
Reference:
2077 this declaration has no storage class or type specifier
Cause:
2064 declaration does not declare anything 29