码迷,mamicode.com
首页 > 编程语言 > 详细

c语言warning总结

时间:2016-12-29 16:31:54      阅读:2451      评论:0      收藏:0      [点我收藏+]

标签:com   函数   爆发   argument   prot   不一致   function   end   lock   

1、function declaration isn’t a prototype
括号中无参数,也要加void

2、array subscript is above array bounds
数组下标大于数组边界

例如:

#define LOCKNET_KEY_LEN 16

#define KEY_LEN 128

UINT8 signHex128[LOCKNET_KEY_LEN] = {0};
zCtrm_Bytes2String(signHex128+KEY_LEN-LOCKNET_KEY_LEN, signtext, LOCKNET_KEY_LEN);

通过看这个waring,看到代码里面的错误,不然这种越界还不知道什么时候就爆发了。

3、pointer targets in passing argument 3 of ‘mpi_read_string’ differ in signedness
第3个参数与‘mpi_read_string’函数中第三个参数类型不一致

4、pointer targets in assignment differ in signedness
参数不一致

5、passing argument 1 of ‘ConvertToBigEndian’ from incompatible pointer type
指针类型不一致

c语言warning总结

标签:com   函数   爆发   argument   prot   不一致   function   end   lock   

原文地址:http://www.cnblogs.com/wenqin/p/6233419.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!