================================
Author: taoyuetao
Email:
tao_yuetao@yahoo.com.cn
Blog: taoyuetao.cublog.cn
================================
在分析
[url=javascript:;]linux[/url]
内核时注意到有些函数会有添加__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.

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

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31100/showart_240177.html

有关gcc的扩展__attribute__((unused))的更多相关文章

  1. GCC扩展 __attribute__ ((visibility("hidden")))

    试想这样的情景,程序调用某函数A,A函数存在于两个动态链接库liba.so,libb.so中,并且程序执行需要链接这两个库,此时程序调用的A函数到底是来自于a还是b呢? 这取决于链接时的顺序,比如先链 ...

  2. c++之__attribute__((unused))

    转自https://blog.csdn.net/u013083059/article/details/19342935 内核时注意到有些函数会有添加__attribute__((unused)), 在 ...

  3. __attribute__((unused))

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

  4. RPM安装gcc gcc-c++扩展

    rpm -ivh cpp--.el5.i386.rpm 回车 rpm -ivh kernel-headers--.el5.i386.rpm 回车 rpm -ivh glibc-headers-.i38 ...

  5. C 语言的 GCC 扩展

    GNU 编译器(GCC)提供了很多 C 语言扩展,编译器会使用该信息生成更高效的机器代码. 内联函数 static inline __attribute__ ((always_inline)) int ...

  6. gcc __attribute__关键字举例之visibility【转】

    转自:https://blog.csdn.net/starstarstone/article/details/7493144?utm_source=tuicool&utm_medium=ref ...

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

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

  8. GNU C 扩展(转)

    GNU CC 是一个功能非常强大的跨平台 C 编译器,它对 C 语言提供了很多扩展,这些扩展对优化.目标代码布局.更安全的检查等方面提供了很强的支持.这里对支持支持 GNU 扩展的 C 语言成为 GN ...

  9. Linux 内核使用的 GNU C 扩展

    gcc核心扩展linuxforum(转)=========================== Linux 内核使用的 GNU C 扩展 =========================== GNC ...

随机推荐

  1. 利用 runtime,解决多次点击相同 button,导致重复跳转的问题-b

    当app有点卡的时候,多次点击相同的button,经常出现,跳转了N次相同的界面(比如闲鱼) 解决办法 用运行时和分类,替换 UIControl 响应事件,根据响应的间隔时间来判断是否执行事件. 详细 ...

  2. python 时间及日期函数

    本人最近新学python ,用到关于时间和日期的函数,经过一番研究,从网上查找资料,经过测试,总结了一下相关的方法. import timeimport datetime '''时间转化为时间戳: 2 ...

  3. opencv 操作本地摄像头实现录像

    直接上代码: // demo1.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> usin ...

  4. 谷歌笔试题——排序,只允许0和其他元素交换

    2.2 长度为n的数组乱序存放着0至n-1. 现在只能进行0与其他数的swap,请设计并实现排序. 这题有一个隐含条件:即数组元素是连续的,即0--n-1,当你排好序后,你会发现数组元素和该元素的下标 ...

  5. 获取C#中exe程序的实例名

    获取sanjiao.frmsanjiao string strPass = @"D:\WinAutoTest\sanjiao.exe"; Assembly assebly = As ...

  6. Handler 接收Parcelable ArrayList时返回空的错误

    遇到一个问题,从handler 接收的Parcelable ArrayList返回空,调试发现这个arraylist生成的时候是有值的,传到handler就没值了 赋值的代码 new Thread(n ...

  7. java.sizeOf

    Introduction With java.SizeOf you can measure the real memory size of your Java objects. Download it ...

  8. BZOJ3781: 小B的询问

    3781: 小B的询问 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 146  Solved: 98[Submit][Status] Descript ...

  9. nvidia gpu fan speed control

    nvidia在linux上控制风扇速度,需要起X,在无显示器链接的服务器上显得有点坑,这里汇总一下整个流程 1.nvidia-xconfig --cool-bits=4 生成xorg.conf 2.在 ...

  10. 【转】can't find referenced method 'android.app.RemoteInput[] getRemoteInputs()' in class android.app.Notification$Action

    原文网址:http://stackoverflow.com/questions/25508735/cant-find-referenced-method-android-app-remoteinput ...