我是靠谱客的博主 勤奋超短裙,这篇文章主要介绍__attribute__((unused))的作用,现在分享给大家,希望可以做个参考。

在分析内核时注意到有些函数会有添加__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.


表示该函数或变量可能不使用,这个属性可以避免编译器产生警告信息

最后

以上就是勤奋超短裙最近收集整理的关于__attribute__((unused))的作用的全部内容,更多相关__attribute__((unused))内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部