有关gcc的扩展__attribute__((unused))
2015-12-22 14:03
441 查看
在分析
linux
内核时注意到有些函数会有添加__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.
表示该函数或变量可能不使用,这个属性可以避免编译器产生警告信息。
linux
内核时注意到有些函数会有添加__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.
表示该函数或变量可能不使用,这个属性可以避免编译器产生警告信息。
相关文章推荐
- tableView的编辑
- Ubuntu安装JDK
- nova-manage service list函数调用过程
- COLOR RGB BGR以及字符串之间转换
- Kibana学习2_geohash算法原理及实现方式
- MySQL用户权限管理
- 转:几款免费的图表js插件
- 有趣的程序
- 数据库性能测试方案示例
- Android WebView远程执行代码漏洞浅析
- QML
- [Android开发]仿天天P图带气泡显示百分比进度的自定义SeekBar
- java启动spring容器
- MYSQL SELECT 过程 转
- MYSQL SELECT 过程 转
- Hive分析hadoop进程日志
- zeromq退出与linger值的设置
- 如何在Visual Studio项目中正确添加汇编代码
- libexpat.a(libexpat.so.0) is needed by apache
- CXF学习笔记二(在WEB容器中发布WebService)