3.8 Information specific to C++

These are some characteristics of ARM C++ to be aware of when combining it with ARM C.

C++ calling conventions

ARM C++ uses the same calling conventions as ARM C with one exception:

  • Nonstatic member functions are called with the implicit this parameter as the first argument, or as the second argument if the called function returns a non int-like struct. This might change in future implementations.

C++ data types

ARM C++ uses the same data types as ARM C with the following exceptions and additions:

  • C++ objects of type struct or class have the same layout that is expected from ARM C if they have no base classes or virtual functions. If such a struct has neither a user-defined copy assignment operator nor a user-defined destructor, it is a Plain Old Data (POD) structure.

  • References are represented as pointers.

  • No distinction is made between pointers to C functions and pointers to C++ nonmember functions.

Symbol name mangling

The linker unmangles symbol names in messages.

C names must be declared as extern "C" in C++ programs. This is done already for the ARM ISO C headers.

Non-ConfidentialPDF file icon PDF versionARM DUI0471M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.