I have a structure containing unsigned chars and bitfields:
struct {
unsigned char byt1 ;
unsigned char var1 :1;
unsigned char byt2 ;
unsigned char var2 :1;
unsigned char var3 :1;
unsigned char var4 :1:
} struct1;
I want to compare this struct with itself. I keep two copies of this struct and I want to just check if anything changed compared to first copy of it.
Is it safe to use memcmp() here? The real struct has 50+ members, and they are all unsigned chars or bits.