The alias function attribute causes the function declaration to appear in the object file as an alias for another symbol. This language feature provides a technique for coping with duplicate or cumbersome names.
The aliased function can be defined after the specification of its alias with this function attribute. C also allows an alias specification in the absence of a definition of the aliased function in the same compilation unit.
void __func2(){ /* function body */ }
void func1() __attribute__((alias("__func2")));
The original_function_name must be the mangled name.
extern "C" __func2(){ /* function body */ }
void func1() __attribute__((alias("__func2")));
The compiler does not check for consistency between the declaration of func1 and definition of __func2. Such consistency remains the responsibility of the programmer.