Skip to main content

IAR Embedded Workbench for Arm 10.10.x

The IAR C/C++ Compiler

このセクションの内容:
Standard C++

In version 9.x, the C++ standard that the compiler supported by default was C++17.

In version 10.x, the default C++ standard is C++20.

The IAR C++ implementation fully complies with the ISO/IEC 14882:2020 C++ ("C++20") standard, except for features related to co-routines, modules, the type char8_t , and initializer statements in range-based for loops. Moreover, some library features are not supported.

The IAR C/C++ Compiler accepts source code written in the C++20 standard or a superset thereof. In C++20, some functionality that was deprecated in C++17 is now removed. For example, the exception specifier throw() (replaced by noexcept).

  • When using the DLIB C++14 library, those features of C++20 that require library support are not available.

  • When using the Libc++ C++20 library, all features of C++20 are available, except as noted below.

The Libc++ library is a C++20 library. In C++20, some functionality that was deprecated in C++14 and C++17 is removed. Examples of removed C++14 features include std::auto_ptr, std::random_shuffle, and std::mem_fun. Examples of removed C++17 features include std::uncaught_exception, functional adapters in the functional header, redundant members of std::allocator and the type traits std::is_literal_type and result_of. For a complete list of limitations, see C/C++標準ライブラリの概要.

The IAR Libc++ library, currently version libc++v17, is taken from LLVM under an open source license and is used as is, with extensions and limitations from the C++20 standard. For more information about the feature set of the LLVM Libc++ library, see libcxx.llvm.org/Status/Cxx17.html.

You can define the preprocessor symbols _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES and _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES to enable support for these features when using the Libc++ library. Note that doing so might break newer features.

C89

In version 9.x, the compiler could be configured to accept C89 source code using the option Project>Options>C/C++ Compiler>Language 1>C dialect>C89.

In version 10.x, it is not possible to configure the compiler to accept C89 source code from the Project Options dialog box. It is still possible on the command line using the deprecated option ‑‑c89, but this will be removed in a future release. Note that compiling legacy C89 code with a modern compiler presents several security risks.

MISRA C

In version 9.x of the compiler, although deprecated and not documented, the command line options ‑‑misrac1998 and ‑‑misrac2004 could still be used to provide support for some legacy projects.

In version 10.x, compiler support for MISRA C has been completely removed. To analyze your code using the MISRA C and MISRA C++ standards, use the C-STAT static analysis tool, which is delivered with IAR Embedded Workbench.