读书人

与 stdlib.h中的realloc冲突?解决办法

发布时间: 2012-03-09 16:54:57 作者: rapoo

与 stdlib.h中的realloc冲突?
In file included from ex_ftp_basic.h:5,
from 2collector.c:5:
/usr/include/stdlib.h:595: error: conflicting types for 'realloc '
../utils/utils.c:624: error: previous implicit declaration of 'realloc ' was here
/usr/include/stdlib.h:597: error: conflicting types for 'free '
../utils/utils.c:541: error: previous implicit declaration of 'free ' was here

../utils/utils.c:624行如下:
hunk = (char*)realloc (hunk, bufsize);

[解决办法]
hunk = (char*)realloc (hunk, bufsize);这样写是对的,但是用realloc 前必须保证hunk非空,是用malloc分配过的,空间不够继续分配。你再试试!
[解决办法]
提示信息仅供参考
[解决办法]
这这.....
很难说...

[解决办法]
贴代码,关键部分就可以了!

读书人网 >C语言

热点推荐