Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067DARM® Developer SuiteVersion 1.2Compilers and Libraries Guide
Preface x Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DARM publicationsThis book contains reference information that is specif
The C and C++ Libraries 4-10 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThe functions listed in Table 4-3 depend indirectly
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-11Use the linker symbol table and cross reference list
The C and C++ Libraries 4-12 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DIf you are re-implementing a function that exists in
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-134.3 Building an application without the C libraryCre
The C and C++ Libraries 4-14 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• Ensure that your initialization veneer is executed
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-15Program designThe functions you must re-implement de
The C and C++ Libraries 4-16 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DUsing high-level functionsHigh-level I/O functions,
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-17fenv.hFunctions in this file work without the requir
The C and C++ Libraries 4-18 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dmath.hFunctions in this file work without the requir
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-19• The remove() and rename() functions are system-spe
Preface ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. xiThe following book describes the C++ language:• ISO/IEC 14882:1998(E),
The C and C++ Libraries 4-20 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.4 Tailoring the C library to a new execution envir
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-212. Calls __rt_lib_init() to initialize referenced li
The C and C++ Libraries 4-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.4.2 Exiting from the programThe program can exit n
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-23The default implementation of __rt_entry:1. Sets up
The C and C++ Libraries 4-24 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DSyntaxextern value_in_regs struct __argc_argv __rt_
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-254.5 Tailoring static data accessThis section describ
The C and C++ Libraries 4-26 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6 Tailoring locale and CTYPEThis section describes
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-27ImplementationTo select an ISO8859-1 (Latin-1 alphab
The C and C++ Libraries 4-28 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6.2 Selecting locale at run timeThe C library func
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-29All locale blocks for a category are collected into
Preface xii Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DFeedbackARM Limited welcomes feedback on both ADS and the documentati
The C and C++ Libraries 4-30 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DUsing the macrosThe data blocks for a single locale
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-31 __C, __C, __C, __C, __C, __C, __C, __C, __C,
The C and C++ Libraries 4-32 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D * - 0xc0-0xdf are uppercase chars except times
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-33Each element gives the position in the collation seq
The C and C++ Libraries 4-34 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D 0x9c, /* n - then 1 n variant */ 0x9e, /* o
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-35 0xac, /* u grave */ 0xad, /* u acute */
The C and C++ Libraries 4-36 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DExample 4-6 LC_MONETARY_DEF__LC_MONETARY_DEF(lcmonet
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-374.6.7 _get_lc_numeric()_get_lc_numeric() must return
The C and C++ Libraries 4-38 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6.8 _get_lc_time()_get_lc_time() must return a poi
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-39 strftime(timestr, sizeof(timestr), "%c"
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 1-1Chapter 1 IntroductionThis chapter introduces the ARM compilers, libraries, l
The C and C++ Libraries 4-40 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6.10 localeconv()localeconv() creates and sets the
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-414.6.11 setlocale()Selects the appropriate locale as
The C and C++ Libraries 4-42 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DIf category is LC_ALL and the most recent successful
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-43Note Because the compiler optimizes the data segment
The C and C++ Libraries 4-44 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6.15 __LC_TIME_DEFThis macro is used to create blo
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-45UsageSee _get_lc_time() on page 4-38. See also __LC_
The C and C++ Libraries 4-46 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6.16 __LC_NUMERIC_DEFThis macro is used to create
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-47 + (~3 & (3
The C and C++ Libraries 4-48 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.6.18 __LC_INDEX_ENDThis macro is used to declare t
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-49 char *mon_grouping; /* A string whose elemen
Introduction 1-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D1.1 About the compilers and librariesADS consists of a suite of
The C and C++ Libraries 4-50 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThe value of p_sign_posn and n_sign_posn are interpr
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-514.7 Tailoring error signaling, error handling, and p
The C and C++ Libraries 4-52 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.7.1 _sys_exit()The library exit function. All exit
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-53ReturnsThe default implementation is a veneer on __u
The C and C++ Libraries 4-54 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D0 The signal was handled.nonzero The calling code
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-55void __default_signal_handler(int signal, int argume
The C and C++ Libraries 4-56 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.7.7 _ttywrch()This function writes a character to
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-574.8 Tailoring storage managementThis section describ
The C and C++ Libraries 4-58 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThis implementation has low overheads, but the cost
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-59• your memory model can supply a block of memory at
Introduction ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 1-31.2 The ARM compilers and librariesThis section gives an overvie
The C and C++ Libraries 4-60 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.8.2 Creating your own storage-management systemYou
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-614.8.3 __Heap_DescriptorYou must define your own impl
The C and C++ Libraries 4-62 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.8.4 __Heap_Initialize()Initializes the heap.Syntax
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-634.8.6 __Heap_ProvideMemory()Called to increase the s
The C and C++ Libraries 4-64 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.8.8 __Heap_Free()Returns previously allocated spac
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-654.8.10 __Heap_Stats()Called from __heapstats() to pr
The C and C++ Libraries 4-66 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.8.12 __Heap_Full()Attempts to acquire a new block
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-674.9 Tailoring the runtime memory modelThis section d
The C and C++ Libraries 4-68 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.9.2 Controlling the runtime memory modelThe behavi
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-694.9.4 __user_initial_stackheap()Returns the location
Introduction 1-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D1.2.2 The C and C++ librariesADS provides the following runtime
The C and C++ Libraries 4-70 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DReturnsThe values returned in r0 to r3 depend on whe
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-71Syntax__value_in_regs struct __heap_extent __user_he
The C and C++ Libraries 4-72 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dpreserve any other registers. On entry to this funct
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-734.9.10 __rt_heap_extend()This function returns a new
The C and C++ Libraries 4-74 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.9.11 __rt_stack_postlongjmp()This function sets sp
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-754.10 Tailoring the input/output functionsThe higher-
The C and C++ Libraries 4-76 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dprintf familyThe printf family consists of _printf()
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-77{ /* Your implementation of ferror */ retur
The C and C++ Libraries 4-78 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.10.2 Target-dependent input/output support functio
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-794.10.3 _sys_open()This function opens a file.SyntaxF
Introduction ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 1-51.3 Linking compiled objectsThe ARM and Thumb linker combines th
The C and C++ Libraries 4-80 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.10.5 _sys_read()This function reads the contents o
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-814.10.6 _sys_write()Writes the contents of a buffer t
The C and C++ Libraries 4-82 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.10.7 _sys_ensure()This function flushes buffers as
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-834.10.9 _sys_seek()This function puts the file pointe
The C and C++ Libraries 4-84 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.10.11 _sys_tmpnam()This function converts the file
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-854.11 Tailoring other C library functionsImplementati
The C and C++ Libraries 4-86 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.11.1 clock()This is the standard C library clock f
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-874.11.3 time()This is the standard C library time() f
The C and C++ Libraries 4-88 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.11.5 rename()This is the standard C library rename
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-894.11.7 getenv()This is the standard C library getenv
Introduction 1-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D1.4 Related utilitiesThis section gives an overview of the utili
The C and C++ Libraries 4-90 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.12 Selecting real-time divisionThe division helper
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-914.13 ISO implementation definitionThis section descr
The C and C++ Libraries 4-92 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DMathematical functionsThe mathematical functions sho
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-93HUGE_VAL is an alias for Inf. Consult the errno vari
The C and C++ Libraries 4-94 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DSignal functionThe signals listed in Table 4-18 are
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-95signal() returns an error code if you try to registe
The C and C++ Libraries 4-96 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• A file can be opened many times for reading, but o
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-97The following characteristics, required to be specif
The C and C++ Libraries 4-98 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThe most important features missing from this releas
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-994.14 C library extensionsThis section describes the
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-1Chapter 2 C and C++ CompilersThis chapter describes the command-line options
The C and C++ Libraries 4-100 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.14.2 strtoll()The strtoll() function converts a s
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-101The bufsize parameter specifies the number of chara
The C and C++ Libraries 4-102 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dalloca() must not be called through a function poin
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-103Example 4-20 heapstats output32272 bytes in 2 free
The C and C++ Libraries 4-104 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.14.11 __heapvalid()The __heapvalid() functionperf
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-1054.15 Library naming conventionsThe filename identif
The C and C++ Libraries 4-106 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dc_t__un Thumb, no stack checking, not reentrant (b
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-107m_t_ps Thumb, soft FPA, pure-endian, stack checkin
The C and C++ Libraries 4-108 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-1Chapter 5 Floating-point SupportThis chapter describes the ARM support for fl
ii Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DARM Developer SuiteCompilers and Libraries GuideCopyright © 1999-2001 ARM Lim
C and C++ Compilers 2-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D2.1 About the C and C++ compilersWherever possible, the c
Floating-point Support 5-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.1 About floating-point supportThe ARM floating-point
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-35.2 The software floating-point library, fplibWhen pro
Floating-point Support 5-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.2.1 Arithmetic on numbers in a particular formatThe
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-55.2.2 Conversions between floats, doubles, and intsThe
Floating-point Support 5-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.2.3 Conversions between long longs and other number
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-75.2.4 Floating-point comparisonsThe routines in Table
Floating-point Support 5-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.3 Controlling the floating-point environmentThis sec
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-9• Bits 22 and 23 control the rounding mode (Table 5-5)
Floating-point Support 5-10 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DTo untrap the Inexact Result exception:__ieee_status(
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-11The fields in Figure 5-2 on page 5-10 are as follows:
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-32.1.2 Source language modesThe ARM compilers have three d
Floating-point Support 5-12 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D__fp_status(_fpsr_IXE | _fpsr_UFE | _fpsr_OFE |
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-13Note It is not guaranteed that the values of these ma
Floating-point Support 5-14 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThe _statusfp functionThe function _statusfp returns
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-15The exception macros are bit fields. The macro FE_ALL
Floating-point Support 5-16 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThe fegetround function returns the current rounding
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-17Then, if the frob() function raises Underflow, it is
Floating-point Support 5-18 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D__softfp__ieee_value_t myhandler(__ieee_value_t op1,
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-19The flags contained in edata are:•edata & FE_EX_R
Floating-point Support 5-20 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D•edata & FE_EX_OUTTYPE_MASK gives the type of the
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-21When the operation is a comparison, the result must b
C and C++ Compilers 2-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D2.2 File usageThis section describes naming conventions a
Floating-point Support 5-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D /* For all other invalid operations, raise SIGFPE
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-23__rt_raise is declared in rt_misc.h.
Floating-point Support 5-24 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.4 The math library, mathlibTrigonometric functions
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-255.4.1 Inverse hyperbolic functions (acosh, asinh, ata
Floating-point Support 5-26 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.4.5 One less than exp(x) (expm1)double expm1(double
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-275.4.9 Return the exponent of a number (ilogb)int ilog
Floating-point Support 5-28 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.4.13 Logarithm of one more than x (log1p)double log
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-295.4.18 Scale a number by a power of two (scalb, scalb
Floating-point Support 5-30 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.5 IEEE 754 arithmeticThe ARM floating-point environ
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-31Numbers stored in the above form are called normalize
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-5Filenames are parsed as follows:• a name starting with ho
Floating-point Support 5-32 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DSample valuesSome sample float and double bit pattern
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-33Table 5-13 Sample double-precision floating-point val
Floating-point Support 5-34 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D5.5.2 Arithmetic and roundingArithmetic is generally
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-355.5.3 ExceptionsFloating-point arithmetic operations
Floating-point Support 5-36 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DTypes of exceptionThe ARM floating-point environment
Floating-point Support ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 5-37(For readers familiar with the IEEE 754 specification
Floating-point Support 5-38 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. A-1Appendix A Via File SyntaxThis appendix describes the syntax of via files acc
Via File Syntax A-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DA.1 Overview of via filesVia files are plain text files that
Via File Syntax ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. A-3A.2 SyntaxVia files must conform to the following syntax rule
C and C++ Compilers 2-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D2.2.2 Included filesSeveral factors affect the way the AR
Via File Syntax A-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• Lines beginning with a semicolon (;) or a hash (#) characte
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. B-1Appendix B Standard C Implementation Definition This appendix gives informati
Standard C Implementation Definition B-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DB.1 Implementation definitionAppendix G
Standard C Implementation Definition ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. B-3B.1.1 TranslationDiagnostic messages pro
Standard C Implementation Definition B-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DInteractive deviceIn an unhosted impleme
Standard C Implementation Definition ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. B-5>>& filename This appends bot
Standard C Implementation Definition B-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• whether a plain int bitfield is treate
Standard C Implementation Definition ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. B-7B.1.12 StatementsThe number of case valu
Standard C Implementation Definition B-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DB.1.14 Library functionsThe ANSI C libra
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. C-1Appendix C Standard C++ Implementation DefinitionThe majority of the language
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-7The original current place install_directory\include is r
Standard C++ Implementation Definition C-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DC.1 EC++ supportARM C++ supports all f
Standard C++ Implementation Definition ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. C-3C.2 Integral conversionDuring integral
Standard C++ Implementation Definition C-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DC.3 Calling a pure virtual functionIf
Standard C++ Implementation Definition ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. C-5C.4 Minor features of language support
Standard C++ Implementation Definition C-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dtypename keyword Yes.Member templates
Standard C++ Implementation Definition ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. C-7C.5 Major features of language support
Standard C++ Implementation Definition C-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DC.6 Standard C++ library implementatio
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. D-1Appendix D C and C++ Compiler Implementation LimitsThis appendix list the imp
C and C++ Compiler Implementation Limits D-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DD.1 C++ ISO/IEC standard limitsThe I
C and C++ Compiler Implementation Limits ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. D-3Case labels for a switch statement,
C and C++ Compilers 2-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DThe search pathTable 2-2 shows how the various command-li
C and C++ Compiler Implementation Limits D-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DD.2 Internal limitsIn addition to th
C and C++ Compiler Implementation Limits ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. D-5D.3 Limits for integral numbersTable
C and C++ Compiler Implementation Limits D-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DD.4 Limits for floating-point number
C and C++ Compiler Implementation Limits ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. D-7DBL_MIN_10_EXPMinimum value of base
C and C++ Compiler Implementation Limits D-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. Glossary-1GlossaryADS See ARM Developer Suite.ANSI American National Standards I
Glossary Glossary-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DCoprocessor An additional processor which is used for certain
Glossary ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. Glossary-3Inline Functions that are repeated in code each time they are
Glossary Glossary-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DScatter-loading Assigning the address and grouping of code an
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. Index-1IndexAabort() 4-22, 4-91, 4-96Access control error 2-37acosh function
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-92.3 Command syntaxThis section describes the command synt
IndexIndex-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DB__backspace() 4-10, 4-15, 4-76Base classes 3-27Berkeley UNIXsea
IndexARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. Index-3-Wg 2-32-Wi 2-32-Wk 2-27-Wl 2-33-Wm 2-33-Wn 2-33-Wo 2-
IndexIndex-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DFferror() 4-10, 4-15, 4-76fgetc() 4-10, 4-15, 4-76fgets() 4-10
IndexARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. Index-5__Heap_Stats() 4-65__Heap_Valid() 4-65Help compiler option 2-1
IndexIndex-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DNatural alignment, C and C++ 3-23New array, C++ C-5New style cas
IndexARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. Index-7C++ 2-3EC++ 2-3strict 2-14strict ANSI C 2-14Specifyingadditi
IndexIndex-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dimplicit conversion 2-33implicit narrowing cast 2-33implicit ret
C and C++ Compilers 2-10 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Ddebug-optionsThis specifies whether or not debug tables
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-11Specifying keyboard inputUse minus – as the source filen
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. iiiContentsARM Developer Suite Compilers and Libraries GuidePrefaceAbout this bo
C and C++ Compilers 2-12 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D2.3.2 Procedure Call Standard optionsThis section applie
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-13Position independence qualifiers/noropiThis option gener
C and C++ Compilers 2-14 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DStack checking qualifiers/noswstackcheckThis option uses
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-15armcpp -ansiCompiles normal ANSI standard C (C mode of C
C and C++ Compilers 2-16 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DYou can also use the -o option to specify a filefor the
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-172.3.6 Specifying output format By default, source files
C and C++ Compilers 2-18 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D-fiThis option is used with -list to list the lines from
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-19the current directory, where file.c is the name of the s
C and C++ Compilers 2-20 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• Use only a single processor or architecture name with
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-21Valid options are:none Selects no floating-point option
Contentsiv Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DChapter 4 The C and C++ Libraries4.1 About the runtime libraries ...
C and C++ Compilers 2-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dsoftvfp Selects software floating-point library (FPLib)
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-23Debug table format optionsThe following option specifies
C and C++ Compilers 2-24 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D2.3.9 Controlling code generation Use the options descri
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-25while (expression) body;as:if (expression) {do body;whil
C and C++ Compilers 2-26 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D-OautoinlineThis option enables automatic inlining. It i
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-27Note Using this option increases code size and decrease
C and C++ Compilers 2-28 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DNote This behavior is not in accordance with the ANSI C
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-29to place a function at a particular address in memory. I
C and C++ Compilers 2-30 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D-S22The memory cannot store halfwords. You can use this
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-312.3.10 Controlling warning messagesThe compiler issues w
ContentsARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. vGlossary
C and C++ Compilers 2-32 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• specifying char, short, float, or enum arguments to va
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-33C2621W: double constant automatically converted to float
C and C++ Compilers 2-34 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dstruct Base { virtual void f(); };struct Derived : Base
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-35By default, unused declaration warnings are given for:•
C and C++ Compilers 2-36 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dint f(int i) {return (int)i;} // Warning: explicit cast
C and C++ Compilers ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 2-372.3.12 Controlling error messagesThe compiler issues err
C and C++ Compilers 2-38 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D-EcThis option suppresses all implicit cast errors, such
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-1Chapter 3 ARM Compiler ReferenceThis chapter gives information on ARM-specifi
ARM Compiler Reference 3-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D3.1 Compiler-specific featuresThis section describes t
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-3Pragmas controlling printf and scanf argument checking
Contentsvi Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
ARM Compiler Reference 3-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DPragmas controlling code generationThe following pragm
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-5Where name is the name to use for the section and sort
ARM Compiler Reference 3-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D3.1.2 Function keywordsSeveral keywords tell the compi
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-7__pure void (*h(void))(void); /* declares 'h&apo
ARM Compiler Reference 3-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dreal_numIs the value passed in r12 to the SWI handler.
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-9__inline int f(int x) {return x*5+1;}int g(int x, int
ARM Compiler Reference 3-10 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DStandard keywordsThese keywords declare a storage cla
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-11number (for example, r4). In C, global register varia
ARM Compiler Reference 3-12 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• A global register variable maps to a callee-saved r
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-13Note The ARM-Thumb Procedure Call Standard requires
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. viiPrefaceThis preface introduces the ARM Developer Suite (ADS) tools and refere
ARM Compiler Reference 3-14 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DExample 3-2 Pointer to packed__packed int *pThere are
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-15volatile The standard ANSI qualifier volatile informs
ARM Compiler Reference 3-16 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D3.2 Language extensionsThis section describes the lan
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-17IdentifiersThe $ character is a legal character in id
ARM Compiler Reference 3-18 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DInline assemblerThe ARM C++ compilers support the syn
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-19Hexadecimal floating-point constantsARM implements an
ARM Compiler Reference 3-20 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DExample 3-6 Linkage specificationextern const int z;
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-213.3 C and C++ implementation details This section des
ARM Compiler Reference 3-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D• In C all character constants have type int. In C++
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-233.3.2 Basic data typesThis section gives information
Preface viii Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DAbout this bookThis book provides reference information for ADS. It
ARM Compiler Reference 3-24 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DFloatFloating-point quantities are stored in IEEE for
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-25• Any quantity that specifies the amount of a shift i
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,
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-27• all C++ structures and classes not using virtual fu
ARM Compiler Reference 3-28 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DPacked structuresA packed structure is one where the
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-29struct X { int x:10; int y:20; int z:5;};The
ARM Compiler Reference 3-30 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067Dstruct X { int x:10; char y:8; int z:5;}The
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-313.4 Predefined macrosTable 3-4 lists the macro names
ARM Compiler Reference 3-32 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D__OPTIMISE_TIME– If -Otime in use.__prettyfunc__name
ARM Compiler Reference ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 3-33__TARGET_FEATURE_HALFWORD– If the target architecture
Preface ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. ixAppendix C Standard C++ Implementation Definition Read this appendix f
ARM Compiler Reference 3-34 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-1Chapter 4 The C and C++ LibrariesThis chapter describes the ARM C and C++ lib
The C and C++ Libraries 4-2 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.1 About the runtime libraries The following runtime
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-34.1.1 Build options and library variantsWhen you buil
The C and C++ Libraries 4-4 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.1.2 Library directory structureThe libraries are in
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-5The following points describe how static data is used
The C and C++ Libraries 4-6 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D4.2 Building an application with the C libraryThis se
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-7Using ARMulatorThe ARM instruction set simulator (ARM
The C and C++ Libraries 4-8 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067DImplementing your own semihosting SWI supportIt is po
The C and C++ Libraries ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-9Overview of semihosting dependenciesThe functions sho
Kommentare zu diesen Handbüchern