zoukankan      html  css  js  c++  java
  • 'gets' undeclared here (not in a function)

    原文:http://www.cnblogs.com/hjj801006/p/3988220.html

    1、在命令行输入:find -name stdio.in.h。查到有两个文件中含有stdio.in.h.

    ./huangwork/atom-sdk/install_sdk/IntelCE-0.34.13452.340510/project_build_i686/IntelCE/autotools-0.29.12293.323798/building/m4-1.4.13/lib/stdio.in.h
    ./huangwork/atom-sdk/install_sdk/IntelCE-0.34.13452.340510/project_build_i686/IntelCE/bison-0.29.12232.321541/bison-2.4.2/lib/stdio.in.h
     
    2、打开第一个文件中的stdio.in.h,没有找到
    _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
     #endif

    即:把第一行注释掉,所以用-表示注释,然后添加第二行和第三行。最后不要忘了添加#endif。
    3、编译,通过!!!!
  • 相关阅读:
    (01)Docker简介
    Gym-101242B:Branch Assignment(最短路,四边形不等式优化DP)
    2019牛客暑期多校训练营(第三场)G: Removing Stones(启发式分治)
    POJ
    高维前缀和
    HDU
    BZOJ
    HDU
    POJ
    Gym-100648B: Hie with the Pie(状态DP)
  • 原文地址:https://www.cnblogs.com/djiankuo/p/6230717.html
Copyright © 2011-2022 走看看