弱符号与弱引用

声明一个外部函数为弱引用

gcc中,我们通过_attribute_ ((weakref))来声明一个外部函数为弱引用。

__attribute__ ((weakref)) void foo();

int main(){

        foo();

}



你可能感兴趣的:(gcc)