JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

__attribute__((weak))

发布时间 2023-08-14 19:39:46作者: 西北小蚂蚁

attribute((weak)):

可以定义两个相同的函数或变量,带__attribute__((weak))的为弱,如果有不带__attribute__((weak))的变量或函数以不带的为准,若没有则以带__attribute__((weak))为准;

  • test_1.c:

#include <stdio.h>

int __attribute__((weak)) i[10] = {0};
void main()
{
    printf("%d\r\n",i[0]);
}
  • test_2.c:
int i[10] = {1};
  • 同时编译结果如下:
    本栏目推荐文章
  • SpringBoot配置报错:Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class
  • Attribute 和 Property 的区别
  • Python中numpy出现has no attribute '_no_nep50_warning'错误的一个解决方案
  • 【pytorch深度学习报错】AttributeError: module 'torch' has no attribute '_six'
  • python3报错 'function' object has no attribute 'func_name'解决
  • __attribute__((packed,aligned(1)))
  • Auto Image Attributes Pro v4.4:优化图片SEO,解锁Google图片流量
  • 记录一次openpyx使用rich_text报错AttributeError: 'TextBlock' object has no attribute 'name'
  • SpringSession+SpringSecurity中如何保存Authentication到Session中的Attribute
  • python3.8 模块 paramiko报错 AttributeError: 'NoneType' object has no attribute 'time'
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们