To prevent linker errors, calls to inline template functions in C++ must be enclosed in an extern “C” declaration. For example:
extern "C" { void nothing(); } int main() { nothing(); }
Inline template function:
.inline nothing nop .end
In C++, #pragma no_side_effect cannot be combined with exceptions. But we know that the code cannot produce exceptions. The compiler might be able to produce even better code by adding the throw()keyword to the template declaration:
extern "C" { int mytemplate(int) throw(); #pragma no_side_effect(mytemplate) }