3.6 Rules for calling between C, C++, and assembly language

Some general rules apply when calling between C, C++, and assembly language.

  • Use C calling conventions.

  • C header files must be wrapped in extern "C" directives before they are included from C++.

  • In C++, nonmember functions can be declared as extern "C" to specify that they have C linkage. Having C linkage means that the symbol defining the function is not mangled. You can use C linkage to implement a function in one language and call it from another.


    Functions that are declared extern "C" cannot be overloaded.
  • Assembly language modules must conform to the appropriate AAPCS standard for the memory model used by the application.

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