雖然__attribute__ ((aligned))
與typedef聲明運作良好,如:是否在typedef聲明上忽略__attribute__((__packed__))?
typedef struct __attribute__((__aligned__(8))) A {
xxx ip ;
xxx udp ;
xxx ports ;
} table ;
我所遇到報表時說,這是不是與__attribute__ ((__packed__))
用typedef的情況下!我正在瀏覽一些相關的問題,其中一些人使用了與我們的代碼相符的typedef的打包屬性。現在
,在我們的代碼,我們定義
typedef struct {
xxx ip ;
xxx udp ;
xxx ports ;
}__attribute__((packed)) table ;
難道上面的聲明,使編譯器默默轉儲包裝屬性聲明?
PS:是的,我可以驗證它,但我現在的情況不同。讓我們說假期和智能手機!
哇這工作,這是非常危險的,idk爲什麼它仍然是一個東西。 – Dmitry