编译时出现各种warning,有些人熟视无睹,毕竟不影响编译,不影响使用,有些人觉得不舒服,总感觉不爽
很不幸我是后者,强迫症…

最近在版本融合工作里,负责开发一个兼容驱动,在写测试文件时就出现了这个警告

1 问题

warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration]

即隐式的声明函数ioctl,也就是说没有添加合适的头文件

2 解决

查了一下,没找到到底是哪个头文件,以前的工程也是有这个问题,参考不了。很烦。
突然想起来,可以在终端查看函数的用法,应该可以看见函数所在的头文件把。
hezaizai@ubuntu$ man ioctl

可以看见ioctl的头文件<sys/ioctl.h>
加上解决。

3、渔?

额,这类问题也可以这么解决,逃…哈哈哈

开玩笑,其实,可参考我另一篇关于linux编译C语言头文件的文章,《Linux编程中C语言头文件位置》https://blog.csdn.net/weixin_43083491/article/details/107867222

warning: implicit declaration of function ‘ioctl‘ [-Wimplicit-function-declaration]相关推荐

  1. linux c warning: implicit declaration of function 'strtok_r'解决方案

    解决方法:警告的文件头部 添加 #define _GNU_SOURCE 编译时出现警告 warning: implicit declaration of function 'strtok_r' war ...

  2. warning: implicit declaration of function导致core

    centos上使用gcc编译某程序得到warning: implicit declaration of function 同时写了一个测试程序用到c++库, 因此使用g++编译. 测试程序无问题.  ...

  3. warning: implicit declaration of function ‘sleep’(添加头文件: #include <unistd.h>)

    ubuntu编译c程序报错: warning: implicit declaration of function 'sleep' 解决方法: 添加头文件: #include <unistd.h& ...

  4. keil写代码时遇到的问题——warning:implicit declaration of function XXXX is invalid in C99

    在用keil4写实验的时候,遇到了如标题所示的警告,warning:implicit declaration of function "XXXX" is invalid in C9 ...

  5. warning: implicit declaration of function ‘XXX’; did you mean ‘YYY’? [-Wimplicit-function-declarati

    1. 问题: warning: implicit declaration of function 'XXX'; did you mean 'YYY'? [-Wimplicit-function-dec ...

  6. 隐形声明警告解决//warning: implicit declaration of function ‘XXX’; did you mean ‘YYY’?

    The Problem warning: implicit declaration of function 'XXX'; did you mean 'YYY'? [-Wimplicit-functio ...

  7. 【C语言】warning: implicit declaration of function ‘xxx’ [-Wimplicit-function-declaration] 的解决方法

    Linux开发C语言应用程序,编译出现以下四条warning: warning: implicit declaration of function 'strcmp' [-Wimplicit-funct ...

  8. 【C语言】warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration] 的解决方法

    Linux环境下编译C语言程序,出现警告: warning: implicit declaration of function 'usleep' [-Wimplicit-function-declar ...

  9. 为什么告警warning implicit declaration of function必须修复

    相关:<C指针截断问题(形如0xaaaabbbbccccdddd > 0xffffffffccccdddd)> 本篇送给每一位写C/C++的朋友. 实例 试着编译这样一段程序 #in ...

最新文章

  1. Disruptor技术调研之配置参数一览
  2. 【Flutter】Flutter 拍照示例 ( Flutter 插件配置 | Flutter 插件源码示例 | iOS 应用配置 | Android 应用配置 )
  3. Bluetooth profile: ATT/GATT(襄坤在线)
  4. 110_Power Pivot特殊结算日期及财年日期
  5. JS调用PHP 和 PHP调用JS的方法举例
  6. Win8系统如何在桌面行显示我的电脑
  7. ssh整合mysql不能自动生成表_ssh整合思想 Spring与Hibernate的整合 项目在服务器启动则自动创建数据库表...
  8. 整理收藏 ASP中常见脚本精华代码
  9. 【ArcGIS|空间分析】叠置分析(易混工具使用)
  10. 【Java与智能设备】 CH05_2 Intent启动内置程序
  11. 无标度网络的C++代码实现
  12. 【UE4】如何使用Composite插件进行绿幕抠图
  13. 磁盘分区:系统C盘空间不足怎么办?
  14. 产品经理究竟是干嘛的
  15. Redis 自定义对象 cannot be cast to java.lang.String
  16. logback启动报错,IllegalStateException: Logback configuration error detected...
  17. steam api接口 php,api.php · FsTeam/tanghuayan - Gitee.com
  18. Java 利用EasyPoi做Excel模板的导入导出操作
  19. 录屏视频损坏怎么修复
  20. 9位院士及12位专家联合发表长文:智能计算的新进展、挑战与未来

热门文章

  1. android编译命令及.mk文件浅析
  2. 钉钉小程序换行和输入空格
  3. python爬虫:使用selenium、unittest和BeautifulSoup爬取斗鱼tv的当前直播人数
  4. 基础计算机知识代码,计算机基础知识(示例代码)
  5. 【Pic】什么格式的图片支持透明色?
  6. DOCTYPE的作用和用法
  7. ESXI 无法打开磁盘“XXX.vmdk”或其所依赖的快照磁盘之一
  8. 利用INF文件来修改注册表
  9. 记一次ThinkStation上Centos显卡驱动的大坑
  10. js输入某年某月某日,判断这一天是这一年的第几天?