unused function warning message(转)
這篇的對象是 static function,
static function 若沒有其它 function 去存取的話,
在 compile 時,會發生 unused error,
可以在 function 前加上 attribute((unused)) 避免出現 unused error,
但如果 function 本體實作有 error 時,仍會被檢查出來。
Case 1
function 沒有被存取
1335 static irqreturn_t xxx_handler(int irq, void *data) 1336 {1337 struct smbchg_chip *chip = (struct smbchg_chip *)data;..........
..... ..... android/kernel/msm-3.18/drivers/power/qpnp-smbcharger.c:1335:20: warning: 'xxx_handler' defined but not used [-Wunused-function] error, forbidden warning: qpnp-smbcharger.c:1335 make[3]: *** [drivers/power/qpnp-smbcharger.o] Error 1 make[2]: *** [drivers/power] Error 2 make[1]: *** [drivers] Error 2 make[1]: *** Waiting for unfinished jobs.... ..... ..... .....
Case 2
function 沒有被存取 且 加上 attribute((unused))
1335 __attribute__((unused)) static irqreturn_t xxx_handler(int irq, void *data) 1336 {1337 struct smbchg_chip *chip = (struct smbchg_chip *)data;...............
compile success
Case 3
function 沒有被存取 且 加上 attribute((unused)) 且 function 本體有 error
1335 static _attribute__((unused)) irqreturn_t xxx_handler(int irq, void *data)1336 {1337 asfadsf1338 struct smbchg_chip *chip = (struct smbchg_chip *)data; ...............
..... ..... android/kernel/msm-3.18/drivers/power/qpnp-smbcharger.c:1337:9: error: 'asfadsf' undeclared (first use in this function)asfadsf^ ..... .....
應用時機
當 coder 尚在 實作 function 本體,並想檢查是否有錯誤時,可以使用
转自:https://www.cnblogs.com/youchihwang/p/8986370.html
转载于:https://www.cnblogs.com/zl1991/p/11316477.html
unused function warning message(转)相关推荐
- R中Warning message:Computation failed in stat_stratum():could not find function “default_missing“
R中画图报Warning message: Computation failed in stat_stratum(): could not find function "default_mi ...
- 关于编译Boost库时出现typedef unused的warning的解决办法
之前在写代码后编译boost库时发现一个很神奇的现象,当我用g++默认的头文件寻址方式(即gcc后面不指定-I,从系统库中寻址),boost库的头文件就不会报warning,而当我用-I来指定boos ...
- Warning message:NAs introduced by coercion
Warning message:NAs introduced by coercion 目录 Warning message:NAs introduced by coercion 问题: 解决: 完整问 ...
- Warning message:In a + b : longer object length is not a multiple of shorter object length
Warning message:In a + b : longer object length is not a multiple of shorter object length 目录 Warnin ...
- geom_signif 函数自己的错误 ——Warning message:
被两个错误搞了,一天---------以此纪念傻逼的自己,,气死了 第一个很傻逼的错误 **Computation failed in `stat_signif()`:not enough 'y' o ...
- Dell(戴尔)笔记本加装内存条后出现警告:“Warning Message : Alter!The amount of system memory has changed”
Dell(戴尔)笔记本加装内存条后出现警告:"Warning Message : Alter!The amount of system memory has changed",点击 ...
- 关于R语言显示“Warning message: In normalizePath(path.expand(path), winslash, mustWork) : path[1]=”问题的解决办法
作者声明:本方法由作者全网首创最先发布,未经允许严禁抄袭等行为,转载请附上原文出处链接,侵权必究! 正文: 笔者也是才接触R语言,还在基础学习阶段,R和RStudio好久没有更新版本了,今天更新了一下 ...
- Error in file(file, “rt“) : cannot open the connection In addition: Warning message:In file(file, “
Error in file(file, "rt") : cannot open the connection In addition: Warning message: In fi ...
- 电脑黑屏:Warning Message Time-of-day not set_please
问题场景: 首先是报Time-of_day not set-please run SETUP progarm. 的警告信息.然后开机黑屏. Warning Message:警告信息 Time-of-d ...
最新文章
- SQLer:无需编程语言即可将SQL查询转换为RESTful API的工具
- Zookeeper知识学习
- LINUX下CPU Load Average的一点研究
- [Intel Edison开发板] 02、Edison开发板入门
- 论述计算机科学与技术专业的狭义与广义,2013年秋季学期计算机科学与技术专业《高等代数》复习提纲与补充题...
- 2699元不加价!魅族16s Pro国家宝藏之越王勾践剑礼盒上架
- mysql创建表有则删除_MySQL创建表和删除表
- Axure资源及原型工具Axure RP 9下载
- 取消百度SiteApp转码
- Oracle并集union和union all
- 设计模式------享元模式和组合模式
- 华硕天选一代无线网卡断网
- 使用window.open打开新窗口被谷歌浏览器拦截
- BIM系统平台建设及实施方案
- al输入标题自动写作
- 选好核心交换机六个关键指标有哪些?
- 智慧政务行业发展报告
- 物联网国赛AIOT智能家居系统部署
- Cocos2d-x 3.X, IOS版添加广点通广告平台
- Phoenix(凤凰)的安装介绍