JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


The armcc Compiler Model

The armcc compiler model models the behavior of the ARM RealView Compiler Tools (RVCT) C/C++ compilers.

The armcc model also models the behavior of the Keil MDG-ARM Microcontroller Development Kit C/C++ Compiler.



Overview

The following file extensions are supported:

Compiler
model
Modeled native compiler Source file extensions Description
armcc ARM Real View Compiler Tools C/C++ compiler .c, .cc, .cpp, .cxx, .ii (case insensitive) Source file extensions indicate the source language. An extension of c or C indicates the C language; the other extensions indicate C++.

Availability

Platform Availability The armcc compiler model is available for all platforms.
Default Recognition/Handling By default, compilations are recognized and handled as follows.
Platform Native Compiler Model Used
All armcc(.exe) armcc
All armcpp(.exe) armcc
All tcc(.exe) armcc
All tcpp(.exe) armcc
Specifying Additional Mappings If your compiler executable has a different name, specify a corresponding COMPILER_MODELS rule to map your executable name to the armcc model.

For full details of all native compilers recognized by CodeSonar by default, see section Compilers Recognized by CodeSonar.

Command Arguments

The armcc compiler model supports the following command arguments.

Option Additional Treatment in Model
--arm Defines macro __arm.
--c90 Sets compilation mode to C. Not passed to armcc invocation.
--c99 Sets compilation mode to C. Not passed to armcc invocation.
--cpp Sets compilation mode to C++. Not passed to armcc invocation.
--cpu value
--cpu=value
Determines which CPU-specific macros will be set.
--dollar Specifies front end option --dollar. Not passed to armcc invocation.
--fp_mode value
--fp_mode=value
Passed to armcc invocation; no additional handling.
--fp16_format value
--fp16_format=value
Passed to armcc invocation; no additional handling.
--fpu value
--fpu=value
Passed to armcc invocation; no additional handling.
--idlist
--i dlist
For each directory dir in the comma-separated string dlist, specifies front end option -Idir. Not passed to armcc invocation.
--jdlist
--j dlist
For each directory dir in the comma-separated string dlist, specifies front end option -Idir. Not passed to armcc invocation.
--preinclude file
--preinclude=file
Specifies front end option --preincludefile. Not passed to armcc invocation.
--restrict Specifies front end option --restrict. Not passed to armcc invocation.
--signed_chars Specifies front end option --signed_chars. Not passed to armcc invocation.
--strict Specifies front end option --strict. Not passed to armcc invocation.
--sys_include file
--sys_include=file
Specifies front end option --sys_include file. Not passed to armcc invocation.
--thumb Defines macro __thumb.
--unsigned_chars Specifies front end option --unsigned_chars. Not passed to armcc invocation.
--vla Specifies front end option --vla. Not passed to armcc invocation.
--via file
--via=file
Take options from file, one per line.

No CodeSonar Build

If -e (-E, --e, -E) is specified, CodeSonar will ignore the compilation and will not generate any corresponding internal representation. If a CodeSonar project is based only on ignored compilations, it will have no contents and so will not be finalized.

Compilation Mode

The compilation mode is the mode in which armcc is invoked, and controls some of the front end options specified by the model. Compilation mode depends on the modeled build command as follows.

ARM Language Extensions

  ARM Extension Compiler Model Action(s)
Assembly Code Assembly code blocks may be included in programs. Blocks are introduced by asm (C++) or __asm (C and C++) and may contain C/C++ comments.

Multiple instructions on a single line must be separated with a semicolon. Instructions that require more than one line must specify line continuation with the backslash character "\".

Ignores everything in asm{} and __asm{} blocks.
Sized Integers Integer types __int8, __int16, __int32, and __int64 are permitted. Uses storage of the appropriate size for values of these types.

Predefined Paths and Macros

By default, the armcc compiler model invokes armcc to extract its predefined macros.

Additional predefined macros and include paths are listed below.

Include path The include directory from the compiler installation location. That is, if the compiler executables are found in directory install_path\bin, the system include directory will be install_path\include
Macros Defined The armcc compiler model defines the following in addition to the standard CodeSonar predefined macros.
__align(x) =
__declspec(x) =
__EDG__ =1
__EDG_VERSION__ =An integral value that encodes the version number of the EDG C front end used by the model. If the front end version is MAJOR.MINOR, the value is MAJOR*100+MINOR.
__ESCAPE__(X) =(0x07FF000&0x07FE001)
__forceinline =
__global_reg(x) =
__inline =
__irq =
__MODULE__ ="module"
__pure =
__softfp =
__svc(x) =
__svc_indirect(x) =
__svc_indirect_r7(x) =
__swi(x) =
__swi_indirect(x) =
__swi_indirect_r7(x) =
__value_in_regs =
WS_S32  =int
WS_U32  =unsigned int
WS_S16  =short
WS_U16  =unsigned short
WS_S8  =char
WS_U8  =unsigned char
Front End Options Always specified:

Depend on compilation mode:

Macros Conditionally Defined CPU-specific macros, depending on the value specified with --cpu=value (if any):
value
(case-insensitive; - and _ interchangeable)
CPU-specific macros defined
--cpu not specified __TARGET_ARCH_4T
__TARGET_CPU_ARM7TDMI
4
4T
5T
5TE
5TEJ
6
6_M
6S_M
6K
6T2
6Z
7
7_R
7_M
7E_M
__TARGET_ARCH_value
__TARGET_CPU_generic
SA_1100 __TARGET_ARCH_4
__TARGET_CPU_value
ARM7TM
ARM7TDM
ARM7TDMI
ARM710T
ARM720T
ARM740T
ARM7TM_S
ARM7TDMI_S
ARM9TDMI
ARM920T
ARM922T
ARM940T
SC100
__TARGET_ARCH_4T
__TARGET_CPU_value
ARM9E
ARM9E_S
ARM946E_S
ARM966E_S
__TARGET_ARCH_5TE
__TARGET_CPU_value
ARM7EJ_S
ARM926EJ_S
ARM1026EJ_S
SC200
__TARGET_ARCH_5TEJ
__TARGET_CPU_value
ARM1136J_S
ARM1136JF_S
__TARGET_ARCH_6
__TARGET_CPU_value
CORTEX_M0
CORTEX_M0PLUS
CORTEX_M1
SC000
__TARGET_ARCH_6_M
__TARGET_CPU_value
MPCORE __TARGET_ARCH_6K
__TARGET_CPU_value
ARM1156T2_S
ARM1156T2F_S
__TARGET_ARCH_6T2
__TARGET_CPU_value
ARM1176JZ_S
ARM1176JZF_S
__TARGET_ARCH_6Z
__TARGET_CPU_value
CORTEX_M4
CORTEX_M7
__TARGET_ARCH_7E_M
__TARGET_CPU_value
CORTEX_M3
SC300
__TARGET_ARCH_7_M
__TARGET_CPU_value
CORTEX_R4
CORTEX_R4F
CORTEX_R7
__TARGET_ARCH_7_R
__TARGET_CPU_value
otherwise __TARGET_ARCH_UNKNOWN
__TARGET_CPU_value
Other conditionally defined macros.
__thumb when
  • --thumb is specified without subsequent --arm,
    or
  • the modeled compiler is tcc(.exe) or tcpp(.exe) and --arm is not specified.
__arm otherwise.
 

To report problems with this documentation, please visit https://support.codesecure.com/.