Czesc,
mam taki oto fragment kodu kompilowany w WinAVR-20100110:
////////////////////////////////////////// struct _TestStruct { unsigned Flag :1; };
unsigned char TestByte; int TestInt;
TestByte = ((struct _TestStruct *)&TestInt)->Flag; ///////////////////////////////////////////
Po skompilowaniu z optymalizacja -O0, -O1 wszystko jest ok. Natomiast po skompilowaniu z optymalizacja -O1, -O2, -O3, -Os, kompilator wypisuje blad: "dereferencing type-punned pointer will break strict-aliasing rules". O co w tym chodzi?
Pzdr, Maciek