From 8383ebb657f7ba42a1613cbdabedafc4e073bc3c Mon Sep 17 00:00:00 2001 From: xjtuwxg Date: Tue, 29 Jul 2025 16:11:53 -0500 Subject: [PATCH 1/2] chore: fix a compilation bug on MacOS and update .gitignore --- .gitignore | 1 + usertests.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b896bbd152..96473764b2 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ kernelmemfs mkfs .gdbinit .gdb_history +.depend diff --git a/usertests.c b/usertests.c index 27b314d35e..0a00b0b63d 100644 --- a/usertests.c +++ b/usertests.c @@ -282,7 +282,7 @@ exectest(void) } void -nullptr(void) +nullptrtest(void) { printf(1, "null pointer test\n"); printf(1, "expect one killed process\n"); @@ -1648,7 +1648,7 @@ main(int argc, char *argv[]) pipe1(); preempt(); exitwait(); - nullptr(); + nullptrtest(); rmdot(); fourteen(); From 62f6664efbbb73b50cdc538c96e72a2d40b45013 Mon Sep 17 00:00:00 2001 From: xjtuwxg Date: Sun, 3 Aug 2025 11:27:02 -0500 Subject: [PATCH 2/2] chore: disable a warning; add more files to .gitignore --- .gitignore | 3 +++ sh.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 96473764b2..6d4bd79403 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ mkfs .gdbinit .gdb_history .depend +.history/ +.vscode/ +cscope.out diff --git a/sh.c b/sh.c index 054bab92b3..a13800e4f1 100644 --- a/sh.c +++ b/sh.c @@ -53,6 +53,8 @@ int fork1(void); // Fork but panics on failure. void panic(char*); struct cmd *parsecmd(char*); +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Winfinite-recursion" // Execute cmd. Never returns. void runcmd(struct cmd *cmd) @@ -129,6 +131,7 @@ runcmd(struct cmd *cmd) } exit(); } +#pragma GCC diagnostic pop int getcmd(char *buf, int nbuf)