我們有多個結構,它們是16字節對齊的。 在以前的GCC版本中,一切正常。 由於我們升級到GCC 4.8.2(以前我們使用了4.6),我們得到了一堆關於這些結構的警告。編譯一個對齊的結構在GCC中給出奇怪的警告
一個例子結構爲:
typedef struct _STRUCT
{
_STRUCT(): a(0),
b(0) {};
uint32_t a;
uint32_t b;
} STRUCT __attribute__((aligned (16)));
編譯此代碼拋出以下警告在使用這個strcut:
warning: ignoring attributes on template argument '_STRUCT' [enabled by default]
我真不明白,這是什麼警告是想告訴我而谷歌搜索也沒有幫助。
「..警告在哪裏使用這個strcut」:你如何使用它? – deviantfan
如何定義'_STRUCT'? –
當我在'std :: list'或'std :: map'中使用struct時,會發生警告,例如'std :: list&aList;' –
evotion