From 1b02b08db18210f2c1efb4e184c482a06f690fbd Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Tue, 2 Aug 2022 09:38:22 -0400 Subject: [PATCH] Mark runcmd with attribute noreturn, since it doesn't return When compiling with gcc version 12, this change also avoids the compiler warning "infinite recursion detected" for runcmd() --- user/sh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/user/sh.c b/user/sh.c index 83dd513..36245b3 100644 --- a/user/sh.c +++ b/user/sh.c @@ -52,6 +52,7 @@ struct backcmd { int fork1(void); // Fork but panics on failure. void panic(char*); struct cmd *parsecmd(char*); +void runcmd(struct cmd*) __attribute__((noreturn)); // Execute cmd. Never returns. void