The packed type attribute

The packed type attribute specifies that the minimum alignment should be used for the members of a structure, class, union, or enumeration type. For structure, class, or union types, the alignment is one byte for a member and one bit for a bit field member. For enumeration types, the alignment is the smallest size that will accomodate the range of values in the enumeration. All members of all instances of that type will use the minimum alignment.

Read syntax diagramSkip visual syntax diagrampacked type attribute syntax
 
>>-__attribute__--((--+-packed-----+--))-----------------------><
                      '-__packed__-'
 

Unlike the aligned type attribute, the packed type attribute is not allowed in a typedef declaration.

Related information