Datasheet

C and C++ Compilers
2-28 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
Note
This behavior is not in accordance with the ANSI C standard.
If the other operand in the expression has type
double
, a constant of
unspecified type is converted to
double
. A cast of a constant of
unspecified type to type T produces a constant of type T (Example 2-1).
Example 2-1 Double and float
float f1(float x) { return x + 1.0; } // Uses float add and is treated the same
// as f2() below, a warning is issued.
float f2(float x) { return x + 1.0f;} // Uses float add with no warning, with
// or without -auto_float_constants.
float f3(double x) { return x + 1.0;} // Uses double add,
// no special treatment.
float f4(float x) { return x + (double)1.0;} // Uses double add,
// no special treatment.
Controlling code and data sections
-zo
This option generates one ELF section for each function in source file.
Output sections are named with the same name as the function that
generates the section. For example:
int f(int x) { return x+1; }
compiled with
-zo
gives:
AREA ||i.f||, CODE, READONLY
f PROC
ADD r0,r0,#1
MOV pc,lr
This option enables the linker to remove unused functions when the
default
-remove
linker option is active. This option increases code size
sightly (typically by a few percent) for some functions because it reduces
the potential for sharing addresses, data, and string literals between
functions. However, when creating code for a library, it can prevent
unused functions being included at the link stage. This can result in the
reduction of the final image size. The option can be used with a linker
scatter-loading description file to place some functions in fast memory
and others in slow memory (see the section on scatter-loading files in the
ADS Linker and Utilities Guide). You can also use a scatter-loading file