Bit Fields (cont)
Warnings when using bit-fields:
-
Little endian and big endian systems will lay out the bits in different ways. This can result in non-portable code in some situations
-
You can't have a pointer to a bit-field member as they may not start on a byte boundary
Eg The following won't compile
int main(void) {
printf("%p\n", &(d.day));
return 0;
}
|
|