À trong tài liệu MPLAB_C_Compiler_dsPIC có nói:
Note: The device architecture requires that words be aligned on even byte
boundaries, so care must be taken when using the packed attribute to
avoid run-time addressing errors.
vậy khai báo như sau sẽ vô nghĩa vì addressing error
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
vậy thì dùng packed Attribute chi cho mệt
|