HP Code Advisor Diagnostics

Action:
Use of '==' to compare 2 strings is unusual and might be done by mistake - check if you should
be using strcmp() instead.
Reference:
4355 the initializer for %n is greater than %s
Cause:
This warning is issued when a large sized array (greater than 32 MB) is getting initialized in the
program.
enum try_stuff {try_array= 0x08000000};
char try[try_array*4] = {1,2,[try_array*4-1]=10 };
Action:
It is safe to create an array of size less than 32 MB.
Reference:
4356 operand of sizeof is a constant rvalue, this might not be what you
intended
Cause:
This warning is issued for sizeof(x) where x is a constant rvalue.
Example:
#include <stdio.h>
#define CONST 10
int foo()
{
printf("%u\n",(unsigned) sizeof(10)); // Issue warning
printf("%u\n",(unsigned) sizeof(CONST)); // Issue warning
return 0;
}
Action:
Using sizeof() on a constant is unusual, and might be done by mistake - check if this is what you
intended.
Reference:
4357 octal escape sequence "%s" is followed by decimal character '%s2'
Cause:
When a non-octal decimal character follows an octal sequence, you may assume that its part of
the escape sequence.
Example:
int main() {
const char *ch0 = "\028\4471";
return 0;
}
Action:
For example: "\028" - Here '8' follows escape sequence '\02'. You can change the string to "\02"
"8".
Reference:
70 Diagnostics Details