3.6 C and C++ implementation compatibility

ARM® Compiler 6 C and C++ implementation details differ from previous compiler versions.

The following table describes the C and C++ implementation detail differences.

Table 3-6 C and C++ implementation detail differences

Feature Older versions of ARM Compiler ARM Compiler 6
Integer operations
Shifts
int shifts > 0 && < 127
int left shifts > 31 == 0
int right shifts > 31 == 0 (for unsigned or positive), -1 (for negative)
long long shifts > 0 && < 63
Warns when shift amount > width of type.
You can use the -Wshift-count-overflow option to suppress this warning.
Integer division Checks that the sign of the remainder matches the sign of the numerator The sign of the remainder is not necessarily the same as the sign of the numerator.
Floating-point operations
Default standard IEEE 754 standard, rounding to nearest representable value, exceptions disabled by default.
All facilities, operations, and representations guaranteed by the IEEE standard are available in single and double-precision. Modes of operation can be selected dynamically at runtime.
This is equivalent to the --fpmode=ieee_full option in older versions of ARM Compiler.
Unions, enums and structs
Enum packing Enums are implemented in the smallest integral type of the correct sign to hold the range of the enum values, unless --enum_is_int is specified in C++ mode. By default enums are implemented as int, with long long used when required.
Signedness of plain bit-fields
Unsigned.
Plain bit-fields declared without either the signed or unsigned qualifiers default to unsigned. The --signed_bitfields option treats plain bit-fields as signed.
Signed.
Plain bit-fields declared without either the signed or unsigned qualifiers default to signed. There is no equivalent to either the --signed_bitfields or --no_signed_bitfields options.
Misc C
sizeof(wchar_t) 2 bytes 4 bytes
Misc C++
C++ library Rogue Wave Standard C++ Library
LLVM libc++ Library

Note

  • When the C++ library is used in source code, there is limited compatibility between object code created with ARM Compiler 6 and object code created with ARM Compiler 5. This also applies to indirect use of the C++ library, for example memory allocation or exception handling.
Implicit inclusion If compilation requires a template definition from a template declared in a header file xyz.h, the compiler implicitly includes the file xyz.cc or xyz.CC. Not supported.
Alternative template lookup algorithms When performing referencing context lookups, name lookup matches against names from the instantiation context as well as from the template definition context. Not supported.
Exceptions Off by default, function unwinding on with --exceptions by default. On by default in C++ mode.
Related reference
3.1 Language extension compatibility: keywords
3.2 Language extension compatibility: attributes
3.3 Language extension compatibility: pragmas
3.7 Compatibility of C++ objects
Non-ConfidentialPDF file icon PDF versionARM DUI0742F
Copyright © 2014-2016 ARM. All rights reserved.