RealView® Compilation Tools Compiler Reference Guide

Version 3.1


Table of Contents

Preface
About this book
Intended audience
Using this book
Typographical conventions
Further reading
Feedback
Feedback on RealView Compilation Tools
Feedback on this book
1. Introduction
1.1. About the ARM compiler
1.2. Source language modes
1.2.1. ISO C90
1.2.2. ISO C99
1.2.3. ISO C++
1.3. Language extensions and language compliance
1.3.1. Language extensions
1.3.2. Language compliance
1.4. The C and C++ libraries
2. Compiler Command-line Options
2.1. Command-line options
2.1.1. ‑Aopt
2.1.2. ‑‑[no_]alternative_tokens
2.1.3. ‑‑[no_]anachronisms
2.1.4. --apcs=qualifer...qualifier
2.1.5. ‑‑arm
2.1.6. ‑‑asm
2.1.7. ‑‑[no_]autoinline
2.1.8. ‑‑bigend
2.1.9. ‑‑[no_]brief_diagnostics
2.1.10. --bss_threshold=num
2.1.11. ‑c
2.1.12. ‑C
2.1.13. ‑‑c90
2.1.14. ‑‑c99
2.1.15. ‑‑[no_]code_gen
2.1.16. --[no_]compile_all_input
2.1.17. ‑‑cpp
2.1.18. ‑‑cpu=list
2.1.19. ‑‑cpu=name
2.1.20. ‑‑create_pch=filename
2.1.21. ‑Dname[(parm-list)][=def]
2.1.22. ‑‑[no_]data_reorder
2.1.23. ‑‑[no_]debug
2.1.24. ‑‑[no_]debug_macros
2.1.25. ‑‑default_extension=ext
2.1.26. ‑‑[no_]dep_name
2.1.27. ‑‑depend=filename
2.1.28. ‑‑depend_format=string
2.1.29. --[no_]depend_system_headers
2.1.30. ‑‑diag_error=tag[,tag,...]
2.1.31. ‑‑diag_remark=tag[,tag,... ]
2.1.32. ‑‑diag_style={arm|ide|gnu}
2.1.33. ‑‑diag_suppress=tag[,tag,...]
2.1.34. --diag_suppress=optimizations
2.1.35. ‑‑diag_warning=tag[,tag,...]
2.1.36. --diag_warning=optimizations
2.1.37. ‑‑[no_]dllexport_all
2.1.38. ‑‑[no_]dllimport_runtime
2.1.39. ‑‑[no_]dollar
2.1.40. ‑‑dwarf2
2.1.41. ‑‑dwarf3
2.1.42. ‑E
2.1.43. ‑‑enum_is_int
2.1.44. ‑‑errors=filename
2.1.45. ‑‑[no_]exceptions
2.1.46. ‑‑[no_]exceptions_unwind
2.1.47. ‑‑[no_]export_all_vtbl
2.1.48. ‑‑[no_]export_defs_implicitly
2.1.49. --[no_]extended_initializers
2.1.50. ‑‑feedback=filename
2.1.51. --[no_]force_new_nothrow
2.1.52. ‑‑forceinline
2.1.53. ‑‑fpmode=model
2.1.54. ‑‑fpu=list
2.1.55. ‑‑fpu=name
2.1.56. ‑‑[no_]friend_injection
2.1.57. ‑‑gnu
2.1.58. ‑‑[no_]guiding_decls
2.1.59. ‑‑help
2.1.60. ‑‑[no_]hide_all
2.1.61. ‑Idir[,dir,...]
2.1.62. ‑‑[no_]implicit_include
2.1.63. --[no_]implicit_include_searches
2.1.64. ‑‑[no_]implicit_typename
2.1.65. ‑‑info=totals
2.1.66. ‑‑[no_]inline
2.1.67. ‑‑interleave
2.1.68. ‑Jdir[,dir,...]
2.1.69. ‑‑kandr_include
2.1.70. ‑Lopt
2.1.71. ‑‑library_interface=lib
2.1.72. --library_type=lib
2.1.73. ‑‑list
2.1.74. ‑‑littleend
2.1.75. ‑‑locale=lang_country
2.1.76. ‑‑loose_implicit_cast
2.1.77. ‑‑[no_]lower_ropi
2.1.78. ‑‑[no_]lower_rwpi
2.1.79. ‑M
2.1.80. ‑‑md
2.1.81. ‑‑message_locale=lang_country[.codepage]
2.1.82. ‑‑min_array_alignment=opt
2.1.83. ‑‑[no_]multibyte_chars
2.1.84. ‑‑[no_]multifile
2.1.85. ‑‑[no_]nonstd_qualifier_deduction
2.1.86. ‑o filename
2.1.87. ‑Onum
2.1.88. ‑‑[no_]old_specializations
2.1.89. ‑Ospace
2.1.90. ‑Otime
2.1.91. ‑‑[no_]parse_templates
2.1.92. ‑‑pch
2.1.93. ‑‑pch_dir=dir
2.1.94. ‑‑[no_]pch_messages
2.1.95. ‑‑[no_]pch_verbose
2.1.96. ‑‑pending_instantiations=n
2.1.97. ‑‑pointer_alignment=num
2.1.98. --[no_]project=filename
2.1.99. ‑‑preinclude=filename
2.1.100. --[no_]reduce_paths
2.1.101. --reinitialize_workdir
2.1.102. ‑‑remarks
2.1.103. --remove_unneeded_entities, --no_remove_unneeded_entities
2.1.104. ‑‑[no_]restrict
2.1.105. ‑‑[no_]rtti
2.1.106. ‑S
2.1.107. ‑‑[un]signed_bitfields
2.1.108. ‑‑[un]signed_chars
2.1.109. ‑‑show_cmdline
2.1.110. ‑‑split_ldm
2.1.111. ‑‑split_sections
2.1.112. ‑‑[no_]strict
2.1.113. ‑‑strict_warnings
2.1.114. ‑‑sys_include
2.1.115. ‑‑thumb
2.1.116. ‑Uname
2.1.117. ‑‑[no_]unaligned_access
2.1.118. ‑‑use_pch=filename
2.1.119. ‑‑[no_]using_std
2.1.120. ‑‑[no_]vectorize
2.1.121. ‑‑[no_]vfe
2.1.122. ‑‑via=filename
2.1.123. --[no_]vla
2.1.124. ‑‑vsn
2.1.125. ‑W
2.1.126. --wchar16
2.1.127. --wchar32
2.1.128. --workdir=directory
2.1.129. ‑‑[no_]wrap_diagnostics
3. Language Extensions
3.1. Preprocessor extensions
3.1.1. #assert
3.1.2. #include_next
3.1.3. #unassert
3.1.4. #warning
3.2. C99 language features available in C90
3.2.1. // comments
3.2.2. Subscripting struct
3.2.3. Flexible array members
3.3. C99 language features available in C++ and C90
3.3.1. Variadic macros
3.3.2. long long
3.3.3. restrict
3.3.4. Hex floats
3.4. Standard C language extensions
3.4.1. Constant expressions
3.4.2. Array and pointer extensions
3.4.3. Block scope function declarations
3.4.4. Dollar signs in identifiers
3.4.5. Top‑level declarations
3.4.6. Benign redeclarations
3.4.7. External entities
3.4.8. Function prototypes
3.5. Standard C++ language extensions
3.5.1. ? operator
3.5.2. Declaration of a class member
3.5.3. friend
3.5.4. Read/write constants
3.5.5. Scalar type constants
3.5.6. Type conversions
3.6. Standard C and standard C++ language extensions
3.6.1. Address of a register variable
3.6.2. Arguments to functions
3.6.3. Anonymous classes, structures and unions
3.6.4. Assembler labels
3.6.5. Empty declaration
3.6.6. Hexadecimal floating‑point constants
3.6.7. Incomplete enums
3.6.8. Integral type extensions
3.6.9. Label definitions
3.6.10. Long float
3.6.11. Non static local variables
3.6.12. Structure, union, enum, and bitfield extensions
3.7. GNU language extensions
3.7.1. Alternate keywords
3.7.2. asm keyword
3.7.3. Case ranges
3.7.4. Cast of a union
3.7.5. Character escape sequences
3.7.6. Compound literals
3.7.7. Designated inits
3.7.8. Conditionals
3.7.9. Initializers
3.7.10. Inline
3.7.11. Extended lvalues
3.7.12. Pointer arithmetic
3.7.13. Statement expressions
3.7.14. Unnamed fields
4. Compiler-specific Features
4.1. Keywords and operators
4.1.1. __align
4.1.2. __alignof__
4.1.3. __ALIGNOF__
4.1.4. __asm
4.1.5. __forceinline
4.1.6. __global_reg
4.1.7. __inline
4.1.8. __int64
4.1.9. __INTADDR__
4.1.10. __irq
4.1.11. __packed
4.1.12. __pure
4.1.13. __smc
4.1.14. __softfp
4.1.15. __svc
4.1.16. __svc_indirect
4.1.17. __svc_indirect_r7
4.1.18. __value_in_regs
4.1.19. __weak
4.1.20. __writeonly
4.2. __declspec attributes
4.2.1. __declspec(dllexport)
4.2.2. __declspec(dllimport)
4.2.3. __declspec(noinline)
4.2.4. __declspec(noreturn)
4.2.5. __declspec(nothrow)
4.2.6. __declspec(notshared)
4.2.7. __declspec(thread)
4.3. Function attributes
4.3.1. __attribute__((alias))
4.3.2. __attribute__((always_inline))
4.3.3. __attribute__((const))
4.3.4. __attribute__((deprecated))
4.3.5. __attribute__((malloc))
4.3.6. __attribute__((noinline))
4.3.7. __attribute__((noreturn))
4.3.8. __attribute__((pure))
4.3.9. __attribute__((section))
4.3.10. __attribute__((unused))
4.3.11. __attribute__((used))
4.3.12. __attribute__((weak))
4.4. Type attributes
4.4.1. __attribute__((aligned))
4.4.2. __attribute((packed))
4.4.3. __attribute__((transparent_union))
4.5. Variable attributes
4.5.1. __attribute__((alias))
4.5.2. __attribute__((at(address)))
4.5.3. __attribute__((aligned))
4.5.4. __attribute__((deprecated))
4.5.5. __attribute__((packed))
4.5.6. __attribute__((section))
4.5.7. __attribute__((transparent_union))
4.5.8. __attribute__((unused))
4.5.9. __attribute__((used))
4.5.10. __attribute__((weak))
4.5.11. __attribute__((zero_init))
4.6. Pragmas
4.6.1. #pragma [no_]anon_unions
4.6.2. #pragma arm
4.6.3. #pragma arm section [section_sort_list]
4.6.4. #pragma diag_default tag[,tag,...]
4.6.5. #pragma diag_error tag[,tag,...]
4.6.6. #pragma diag_remark tag[,tag,...]
4.6.7. #pragma diag_suppress tag[,tag,...]
4.6.8. #pragma diag_warning tag[, tag, ...]
4.6.9. #pragma [no_]exceptions_unwind
4.6.10. #pragma hdrstop
4.6.11. #pragma import symbol_name
4.6.12. #pragma [no_]inline
4.6.13. #pragma no_pch
4.6.14. #pragma Onum
4.6.15. #pragma once
4.6.16. #pragma Ospace
4.6.17. #pragma Otime
4.6.18. #pragma pop
4.6.19. #pragma push
4.6.20. #pragma [no_]softfp_linkage
4.6.21. #pragma unroll [(n)]
4.6.22. #pragma unroll_completely
4.6.23. #pragma thumb
4.7. Instruction intrinsics
4.7.1. __breakpoint
4.7.2. __builtin_clz
4.7.3. __builtin_constant_p
4.7.4. __builtin_expect
4.7.5. __builtin_frame_address
4.7.6. __builtin_return_address
4.7.7. __builtin_popcount
4.7.8. __cdp
4.7.9. __clrex
4.7.10. __clz
4.7.11. __current_pc
4.7.12. __current_sp
4.7.13. __disable_fiq
4.7.14. __disable_irq
4.7.15. __enable_fiq
4.7.16. __enable_irq
4.7.17. __fabs
4.7.18. __fabsf
4.7.19. __force_stores
4.7.20. __ldrex
4.7.21. __ldrt
4.7.22. __memory_changed
4.7.23. __nop
4.7.24. __pld
4.7.25. __pli
4.7.26. __qadd
4.7.27. __qdbl
4.7.28. __qsub
4.7.29. __rbit
4.7.30. __rev
4.7.31. __return_address
4.7.32. __ror
4.7.33. __schedule_barrier
4.7.34. __semihost
4.7.35. __sev
4.7.36. __sqrt
4.7.37. __sqrtf
4.7.38. __ssat
4.7.39. __strex
4.7.40. __strt
4.7.41. __swp
4.7.42. __usat
4.7.43. __wfe
4.7.44. __wfi
4.7.45. __yield
4.7.46. ARMv6 SIMD intrinsics
4.7.47. ETSI basic operations
4.7.48. C55x intrinsics
4.7.49. Named register variables
4.8. Compiler predefines
4.8.1. Predefined macros
4.8.2. Function names
5. C and C++ Implementation Details
5.1. C and C++ implementation details
5.1.1. Character sets and identifiers
5.1.2. Basic data types
5.1.3. Operations on basic data types
5.1.4. Structures, unions, enumerations, and bitfields
5.2. C++ implementation details
5.2.1. Using the ::operator new function
5.2.2. Tentative arrays
5.2.3. Old-style C parameters in C++ functions
5.2.4. Anachronisms
5.2.5. Template instantiation
5.2.6. Namespaces
5.2.7. C++ exception handling
5.2.8. Extern inline functions
A. Via File Syntax
A.1. Overview of via files
A.1.1. Via file evaluation
A.2. Syntax
B. Standard C Implementation Definition
B.1. Implementation definition
B.1.1. Translation
B.1.2. Environment
B.1.3. Identifiers
B.1.4. Characters
B.1.5. Integers
B.1.6. Floating‑point
B.1.7. Arrays and pointers
B.1.8. Registers
B.1.9. Structures, unions, enumerations, and bitfields
B.1.10. Qualifiers
B.1.11. Expression evaluation
B.1.12. Preprocessing directives
B.1.13. Library functions
B.2. Behaviors considered undefined by the ISO C Standard
C. Standard C++ Implementation Definition
C.1. Integral conversion
C.2. Calling a pure virtual function
C.3. Major features of language support
C.4. Standard C++ library implementation definition
D. C and C++ Compiler Implementation Limits
D.1. C++ ISO/IEC standard limits
D.2. Limits for integral numbers
D.3. Limits for floating‑point numbers
E. Using NEON Support
E.1. Introduction
E.2. Vector data types
E.3. Intrinsics
E.3.1. Addition
E.3.2. Multiplication
E.3.3. Subtraction
E.3.4. Comparison
E.3.5. Absolute difference
E.3.6. Max/Min
E.3.7. Pairwise addition
E.3.8. Folding maximum
E.3.9. Folding minimum
E.3.10. Reciprocal/Sqrt
E.3.11. Shifts by signed variable
E.3.12. Shifts by a constant
E.3.13. Shifts with insert
E.3.14. Loads and stores of a single vector
E.3.15. Loads and stores of an N‑element structure
E.3.16. Extract lanes from a vector
E.3.17. Set lanes within a vector
E.3.18. Initialize a vector from bit pattern
E.3.19. Set all lanes to same value
E.3.20. Combining vectors
E.3.21. Splitting vectors
E.3.22. Converting vectors
E.3.23. Table look up
E.3.24. Extended table look up intrinsics
E.3.25. Operations with a scalar value
E.3.26. Vector extract
E.3.27. Reverse vector elements (swap endianness)
E.3.28. Other single operand arithmetic
E.3.29. Logical operations
E.3.30. Transposition operations
E.3.31. Vector reinterpret cast operations

Proprietary Notice

Words and logos marked with ® or ™ are registered trademarks or trademarks owned by ARM Limited. Other brands and names mentioned herein may be the trademarks of their respective owners.

Neither the whole nor any part of the information contained in, or the product described in, this document may be adapted or reproduced in any material form except with the prior written permission of the copyright holder.

The product described in this document is subject to continuous developments and improvements. All particulars of the product and its use contained in this document are given by ARM in good faith. However, all warranties implied or expressed, including but not limited to implied warranties of merchantability, or fitness for purpose, are excluded.

This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable for any loss or damage arising from the use of any information in this document, or any error or omission in such information, or any incorrect use of the product.

Where the term ARM is used it means “ARM or any of its subsidiaries as appropriate”.

Confidentiality Status

This document is Non-Confidential. The right to use, copy and disclose this document may be subject to license restrictions in accordance with the terms of the agreement entered into by ARM and the party that ARM delivered this document to.

Product Status

The information in this document is final, that is for a developed product.

Revision History
Revision AMarch 2007Release 3.1 for RVDS v3.1
Revision AApril 2010Documentation update for Release 3.1 for RVDS v3.1
Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential