Datasheet

ARM Compiler Reference
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-19
Hexadecimal floating-point constants
ARM implements an extension to the syntax of numeric constants in C to enable explicit
specification of floating-point constants as IEEE bit patterns. The syntax is:
0f_n
Interpret an 8-digit hex number n as a
float
.
0d_nn
Interpret a 16-digit hex number nn as a
double
.
There must be exactly eight digits for
float
constants. There must be exactly 16 digits
for
double
constants.
Read/write constants
For C++ only, a linkage specification for external constants indicates that a constant can
be dynamically initialized or have mutable members.
Note
The use of
"C++:read/write"
linkage is only necessary for code compiled
/ropi
or
/rwpi
.
If you recompile existing code with either of these options, you must change the linkage
specification for external constants that are dynamically initialized or have mutable
members.
Compiling C++ with either the
/ropi
or
/rwpi
options deviates from the C++ standard.
The declarations in Example 3-5 assume that
x
is in a read-only segment.
Example 3-5 External access
extern const T x;
extern "C++" const T x;
extern "C" const T x;
Dynamic initialization of
x
(including user-defined constructors) is not possible for the
constants and
T
cannot contain mutable members. The new linkage specification in
Example 3-6 on page 3-20 declares that
x
is in a read/write segment (even if it was
initialized with a constant). Dynamic initialization of
x
is allowed and
T
can contain
mutable members. The definitions of
x
,
y
, and
z
in another file must have the same
linkage specifications.