SLAU131V October 2004 – February 2020
C++ compilers use name mangling to avoid conflicts between identically named functions and variables. If name mangling were not used, symbol name clashes can occur.
You can use the demangler (dem430) to demangle names and identify the correct symbols to use in assembly. See the "C++ Name Demangler" chapter of the MSP430 Optimizing C/C++ Compiler User's Guide for details.
To defeat name mangling in C++ for symbols where polymorphism (calling a function of the same name with different kinds of arguments) is not required, use the following syntax:
extern "C" void somefunc(int arg);
The above format is the short method for declaring a single function. To use this method for multiple functions, you can also use the following syntax:
extern "C"
{
void somefunc(int arg);
int anotherfunc(int arg);
...
}