HP Code Advisor Diagnostics Reference Guide (5900-1865, July 2011)
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:
2.147 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:
2.148 4360 size of types of consecutive bitfields are different, bitfield
packing behavior may be different across compiler
Cause:
This warning is issued during bitfield packing when the types in the structure are different.
Example:
#include<stdio.h>
struct node1
{
bool b1:1;
short s:1;
bool b:1;
}head1;
int main()
{
printf ("sizeof struct node1 is : %lu\n", sizeof(head1));
return 0;
}
Action:
It is good to use similar types for bitfield packing. This is because, bitfield packing behavior might
be different across compilers.
Reference:
2.149 4361 64 bit migration: size of types of consecutive bitfields are
different, bitfield packing behavior may be different across compilers
Cause:
2.147 4357 octal escape sequence "%s" is followed by decimal character '%s2' 67