Chinaunix首页 | 论坛 | 博客
  • 博客访问: 122349
  • 博文数量: 31
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 85
  • 用 户 组: 普通用户
  • 注册时间: 2014-12-18 15:18
文章分类
文章存档

2017年(1)

2016年(1)

2015年(26)

2014年(3)

我的朋友

分类: C/C++

2015-06-23 15:42:07

内核时注意到有些函数会有添加__attribute__((unused)),
在gcc手册中找到了有关的解释:
unused:This attribute, attached to a function, means that the function is meant to be
        possibly unused. GCC will not produce a warning for this function.
===============================================================================
used: This attribute, attached to a function, means that code must be emitted for the
       function even if it appears that the function is not referenced. This is useful,
       for example, when the function is referenced only in inline assembly.

表示该函数或变量可能不使用,这个属性可以避免编译器产生警告信息。
阅读(1288) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~