浏览代码

fix(sh): ignore -Winfinity-recursion

greatbridf 1 年之前
父节点
当前提交
b6dbdcae1e
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      user-space-program/sh.c

+ 3 - 0
user-space-program/sh.c

@@ -56,6 +56,8 @@ int fork1(void);  // Fork but panics on failure.
 void panic(char*);
 void panic(char*);
 struct cmd *parsecmd(char*);
 struct cmd *parsecmd(char*);
 
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Winfinite-recursion"
 // Execute cmd.  Never returns.
 // Execute cmd.  Never returns.
 void
 void
 runcmd(struct cmd *cmd)
 runcmd(struct cmd *cmd)
@@ -133,6 +135,7 @@ runcmd(struct cmd *cmd)
   }
   }
   _exit(0);
   _exit(0);
 }
 }
+#pragma GCC diagnostic pop
 
 
 int
 int
 getcmd(char *buf, int nbuf)
 getcmd(char *buf, int nbuf)