在centos7下安装libiconv-1.14.tar.gz时遇到如下错误:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)
解决方法如下:
vi srclib/stdio.h
找到
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
然后去掉:
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
改成:
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#endif
然后重新make && make install,问题解决。
阅读(7511) | 评论(0) | 转发(0) |