Datasheet

ARM Compiler Reference
3-26 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
If the pointers point to objects whose size is one, two, or four bytes, the natural
alignment of the object ensures that the division is exact, provided the objects are
not packed.
For packed or longer types, such as
double
and
struct
, both pointers must point
to elements of the same array.
3.3.4 Structures, unions, enumerations, and bitfields
This section describes the implementation of the structured data types
union
,
enum
, and
struct
. It also discusses structure padding and bitfield implementation.
Unions
When a member of a
union
is accessed using a member of a different type, the resulting
value can be predicted from the representation of the original type. No error is given.
Enumerations
An object of type
enum
is implemented in the smallest integral type that contains the
range of the
enum
. The type of an
enum
is one of the following, according to the range of
the
enum
:
unsigned char
signed char
unsigned short
signed short
unsigned int
(C++ always, C except when
-strict
)
signed int
.
Implementing
enum
in this way can reduce data size. The command-line option
-fy
sets
the underlying type of
enum
to
signed int
. See About the C and C++ compilers on
page 2-2 for more information on the
-fy
option.
Unless you use the
-strict
option,
enum
declarations can have a comma at the end as in:
enum { x = 1, };
Structures
The following points apply to:
all C structures