Linux|Linux的奇怪错误记录

  1. error: ‘for’ loop initial declarations are only allowed in C99 mode
    for(int i = 0; i < 31; i++){
note提示里面已有解决方法 note: use option -std=c99 or -std=gnu99 to compile your code所以gcc只需要添加参数: gcc -std=c99 target.c 其他版本c11: gcc -std=c1x gcc -std=c11 gcc --version//查看版本

  1. error: unknown type name ‘sigset_t’

    warning: implicit declaration of function ‘sigemptyset’ [-Wimplicit-function-declaration]

    error: ‘SIG_BLOCK’ undeclared (first use in this function)
解决方法: gcc -std=gnu99 target.c

  1. man文档不全
下载: yum install man-pages其他命令不全: yum -y install gdb yum -y install tree

    推荐阅读