| |||
| Home > About Previous Releases > Differences between RVCT v2.2 and RVCT v2.1 > Changes to the ARM compiler in RVCT v2.2 | |||
The following changes were made in RVCT v2.2:
The ARM compiler offers new options to provide greater control of how dynamic symbols are exported, that is, use:
--export_all_vtbl to export all
virtual table functions and RTTI for classes with a key function
--export_defs_implicitly to export
definitions where the prototype was marked dllimport.
The ARM compiler offers new options to give symbol visibility when building shared objects or DLLs, that is, use:
--dllexport_all to provide dynamic
visibility of all global symbols unless specified otherwise
--no_hide_all to export all extern definitions
and import all undefined references.
The new __swi_indirect_r7 behaves
like __swi_indirect_r12 except that it uses r7 instead
of r12. Thumb applications on ARM Linux use __swi_indirect_r7 to make
kernel syscalls.
The behavior of --force_new_nothrow has
been enlarged so that it causes any overloaded global operator
new to be treated as throw().
The ARM compiler C implementation has been changed so that it now issues a Warning for out-of-range enumerator values.
In strict C, enumerator values must be representable as ints,
for example, they must be in the range -2147483648 to +2147483647
(inclusive). In previous releases of RVCT out-of-range values were
cast to int without a warning (unless you specified
the --strict option).
In RVCT v2.2, such values are treated the same way as in C++, that is, they are treated as unsigned int, long long, or unsigned long long. This means the size of enum types with out-of-range values might be different in C if you are using the latest release of RVCT. For example:
enum E1 { k1 = 0xffffffff }; /* value == 2147483648u; out-of-range in C */
/* C: before 2.2: sizeof(enum E1) == 1 */
/* C: 2.2: sizeof(enum E1) == 4 */
/* C++: all: sizeof(enum E1) == 4 */
enum E2 { k2 = (int)0xffffffff }; /* value == -1; in range */
/* C: before 2.2: sizeof(enum E1) == 1 */
/* C: 2.2: sizeof(enum E1) == 1 */
/* C++: all: sizeof(enum E1) == 1 */
enum E3 { k3 = -1, k4 = 0xffffffff }; /* value == 2147483648u; out-of-range in C */
/* C: before 2.2: sizeof(enum E1) == 1 */
/* C: 2.2: sizeof(enum E1) == 8; use long long */
/* C++: all: sizeof(enum E1) == 8; use long long */
To ensure that out-of-range Warnings are reported, use the following command to change them into Errors:
armcc --diag_error 66 ...
There is no change if you are using C++, or the command-line
options --enum_is_int, --strict,
or --strict_warnings.
The ARM compiler now supports the use of the __attribute__ keyword
in both ARM and GNU mode.
The ARM compiler now supports a new variable attribute, zero_init or __zero_init__,
to specify that a variable with no initializer is placed in a ZI
data section.
The ARM compiler provides a new option, --dwarf3,
to specify DWARF 3 standard debug tables to describe ARM or Thumb
programs when compiling code written in C or C++. If you do not
specify a format, the compiler assumes DWARF 2.
The ARM compiler supports a new environment variable RVCT22_CCOPT that enables
you to specify command-line options to the compiler.
RVCT v2.2 supports the command-line option --apcs
/fpic to compile code that is compatible with System V
shared libraries. Use this option to generate read-only position-independent
code where relative address references are independent of the location
where your program is loaded.
The ARM compiler provides new intrinsics to control interrupt handling:
__enable_irq() and __disable_irq()
__enable_fiq() and __disable_fiq().
The ARM compiler provides new intrinsics to control optimization:
__schedule_barrier()
__force_stores()
__memory_changed().
The ARM compiler includes new options to enable or disable implicit determination, from context, whether a template parameter dependent name is a type or nontype, that is, use:
--implicit_typename
--no_implicit_typename.
The default is --no_implicit_typename.
When you invoke the compiler, you can use the --show_cmdline option
to see how the compiler has processed the command line. The commands
are shown normalized, and the contents of any via files are expanded.
However, using this option does not trap accidental errors in your
command line.
The ARM compiler is no longer guaranteed to be ISO
C and C++ standard-compliant with respect to floating-point arithmetic
at optimization level -O3. You must use the --fpmode=std option
to ensure ISO C and C++ compliance.
The ARM compiler now places const volatile (and volatile const) data in RW or ZI sections, as mandated by the ISO C standard. Previously such data was placed in RO sections. This might affect your code if you have made assumptions about the placement of data by the compiler.