9.4 __alignof__

The __alignof__ keyword enables you to enquire about the alignment of a type or variable.

Note

This keyword is a GNU compiler extension that the ARM compiler supports.

Syntax

__alignof__(type)
__alignof__(expr)
Where:
type
is a type
expr
is an lvalue.

Return value

__alignof__(type) returns the alignment requirement for the type type, or 1 if there is no alignment requirement.
__alignof__(expr) returns the alignment requirement for the type of the lvalue expr, or 1 if there is no alignment requirement.

Example

int Alignment_0(void)
			{
			return __alignof__(int);
			}
			
Related reference
9.3 __ALIGNOF__
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.