HP Code Advisor Diagnostics

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:
4361 64 bit migration: size of types of consecutive bitfields are different,
bitfield packing behavior may be different across compilers
Cause:
In a 32–bit to 64–bit migration scenario, this warning is issued during bitfield packing when the
types in the structure are different.
Example:
#include<stdio.h>
enum name {first, middle, last};
struct node2
{
long l:1;
name n:1;
}head2;
int main()
{
printf ("sizeof struct node2 is : %lu\n", sizeof(head2));
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:
4363 possible mismatch in parameters passed to %n, previously seen %p
Cause:
During compilation of C programs, when a call is made to a function without prototype, the
compiler does not know the exact parameter types. It tries to get this information from the actual
4360 size of types of consecutive bitfields are different, bitfield packing behavior may be different across compiler 71