編譯安裝時出現下列錯誤,導緻編譯不通過。
./stdio.h:1010:1: error: ‘gets’ undeclared here (not in a function)
_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);
解決方法:
修改srclib/stdio.in.h,将_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);修改為下列内容,大概在698行。
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, “gets is a security hole – use fgets instead”);
#endif
修改前如下:
修改後如下:
重新configure,再make,通過。