关于warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
来源:互联网 发布:ubuntu 查找组 编辑:程序博客网 时间:2024/05/17 22:55
今天在编译代码的时候出现的问题----warning: function declaration isn’t a prototype,本来对这个warning不打算理睬的,后来转念一想,对一个写代码的人来说要做到编译的时候一个warning也没有,这不仅关乎代码的健壮性更是良好习惯的问题,所以决定把这个警告看看。
这个警告出现在代码typedef.h中第21行:
typedef void (*FP)() ; //program start address
乍一看这行语句并没有什么问题,一个typedef定义的数据结构FP而且是个函数指针。但是我们要注意到这样定义一个函数类型需要指定函数的参数(int char etc).
把代码改为 typedef void (*FP)(void) ;重新编译后那个警告没了。
这样做的好处是我们新定义一个数据类型为我们后面使用带来了方便。对FP的使用就和int ,char一样。比如我们可以定义这样一个函数 FP prost;
- 关于warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- warning: function declaration isn’t a prototype(函数声明不是原型)
- warning: function declaration isn't a prototype
- warning: function declaration isn't a prototype
- warning: function declaration isn't a prototype
- warning: function declaration isn’t a prototype的解决方法
- function declaration isn't a prototype解决办法
- function declaration isn't a prototype解决办法
- 警告:warning: function declaration isn't a prototype
- warning: function declaration isn't a prototype原因分析
- 解决: 编译警告 : “warning: function declaration isn't a prototype ”
- warning: function declaration isn't a prototype 解决方法
- warning: function declaration isn’t a prototype解决方法
- C warning: function declaration isn’t a prototype
- 苹果WWDC将于6月6日揭幕 可能宣布iPhone 5,3KI4
- 一个新成员--机器人Cathy
- Java Web应用开发中的一些概念
- PHP+MYSQL分页原理
- Adobe Acrobat Pro中文本框字体的设置
- 关于warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- EJB概念解析!!
- DP 01背包 hdu 2602
- Dialog总结(一)
- 需求,想读懂你的心很难
- PHP上传原理及应用
- 菜鸟入门之浅谈函数重载和多态的区别
- Playing Video on the iPhone and iPad 播放器
- OSGi Web启动的classloader机制(基于equinox3.5.2)