#include <stdio.h>
int fun()
{
printf("func\n");
return 0;
}
int f() __attribute__((weak, alias("fun")));
#define weak_alias(name, aliasname) \
typeof(name) aliasname __attribute__((weak, alias(#name)))
weak_alias(fun, fff);
#define strong_alias(name, aliasname) \
typeof(name) aliasname __attribute__((alias(#name)))
strong_alias(fun, ffff);
int main()
{
f();
fff();
ffff();
return 0;
}
$ ./a.exe
func
func
func