This question is quite old, but I had a similar problem with GCC 10.3. Despite the warning indicating
[-Wattributes]
, I found that it was controlled by the -Wpacked
option: "Warn if a structure is given the packed attribute, but the packed attribute has no effect on the layout or size of the structure. Such structures may be mis-aligned for little benefit." It seems that it warns of potential inefficiency if the packed struct is used in specific ways.