转自https://blog.csdn.net/u013083059/article/details/19342935

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

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

c++之__attribute__((unused))的更多相关文章

  1. 有关gcc的扩展__attribute__((unused))

    ================================ Author: taoyuetao Email: tao_yuetao@yahoo.com.cn Blog: taoyuetao.cu ...

  2. __attribute__((unused))

    在gcc手册中找到了有关的解释: unused:This attribute, attached to a function, means that the function is meant to ...

  3. 练习使用 __attribute__ 属性(仿照内核)

    上一篇文章分析了内核中各种 initcall 的调用过程,在这个基础上大概掌握了内核中使用的这种方法,于是参考内核及网友的文章自己动手写了下,记录在这个随笔中. 源代码如下: #include < ...

  4. __attribute__的一些相关属性

    __attribute__((format()))  这个format有3个参数. int my(NSString *str,NSString *str1,NSArray*str2,...) __at ...

  5. 利用gcc的__attribute__编译属性section子项构建初始化函数表【转】

    转自:https://my.oschina.net/u/180497/blog/177206 gcc的__attribute__编译属性有很多子项,用于改变作用对象的特性.这里讨论section子项的 ...

  6. 利用__attribute__((section()))构建初始化函数表【转】

    转自: https://mp.weixin.qq.com/s?__biz=MzAwMDUwNDgxOA==&mid=2652663356&idx=1&sn=7797629530 ...

  7. unused function warning message

    這篇的對象是 static function, static function 若沒有其它 function 去存取的話, 在 compile 時,會發生 unused error, 可以在 func ...

  8. unused function warning message(转)

    這篇的對象是 static function,static function 若沒有其它 function 去存取的話,在 compile 時,會發生 unused error,可以在 functio ...

  9. u-boot源码分析之C语言段

    题外话: 最近一直在学习u-boot的源代码,从代码量到代码风格,都让我认识到什么才是真正的程序.以往我所学到的C语言知识和u-boot的源代码相比,实在不值一提.说到底,机器都是0和1控制的.感觉这 ...

随机推荐

  1. Nginx安装详细指南

    nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境.  gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有g ...

  2. spring mvc 为什么这么多xml

    spring web mvc 处理流程 Architecture web.xml (webapp必要配置) 作用:spring web mvc 使用dispatcherServlet 分发reques ...

  3. PHP的 preg_match_all

    语法:int preg_match_all ( string pattern, string subject, array &matches [, int flags] ) 这个函数的返回值是 ...

  4. Mongo数据库基本操作

    从这两个类的继承来看,connection是继承了MongoClient的,建议使用MongoClient而不是使用Connection.(也就是说,MongoClient可以使用方法Connecti ...

  5. select 查询

    使用as给字段起别名,例如:select name as 姓名 from student; 模糊匹配(like) "_":一个占位符.例子:select * from studen ...

  6. mongodb集群配置分片集群

    测试环境 操作系统:CentOS 7.2 最小化安装 主服务器IP地址:192.168.197.21 mongo01 从服务器IP地址:192.168.197.22 mongo02 从服务器IP地址: ...

  7. ssh 制作免密登录(免密登录多台服务器)

    场景:服务器B (192.168.1.101)免密登录A(192.168.1.100)服务器 1.登录服务器B ①生产公钥 ssh-keygen -t rsa Enter file in which ...

  8. docker安装solr集群5.3.1

    docker-compose.yml: version: '3' services: zookeeper-A: image: zookeeper:3.4.11 ports: - "12181 ...

  9. EF 指定字段修改

    public virtual void Modify(T model, params string[] ProNames) { DbEntityEntry entry = db.Entry<T& ...

  10. python3学习笔记六(元组)

    元组 创建空元组 tup1 = () #空元组print(type(tup1))print(tup1) tup2 = (10)tup3 = (10,)print(type(tup2)) #不加逗号,类 ...