From a01687b0de67ff82c8e3b404b5b7f133d62faeac Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 25 Feb 2023 16:57:35 -0800 Subject: [PATCH] schism: drop NORETURN attribute use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is just generating pointless noise from gcc: ``` gcc -DHAVE_CONFIG_H -I. -I.. -D_USE_AUTOCONF -D_GNU_SOURCE -I../include -I. -I/usr/include/SDL2 -D_REENTRANT -DUSE_ALSA -DUSE_DLTRICK_ALSA -DUSE_OSS -DUSE_NETWORK -DUSE_X11 -DUSE_XV -DHAS_YM3812=1 -DHAS_Y8950=0 -DHAS_YM3526=0 -DUSE_FLAC -DUSE_ROCKET -g -O2 -MT schism/main.o -MD -MP -MF $depbase.Tpo -c -o schism/main.o ../schism/main.c &&\ mv -f $depbase.Tpo $depbase.Po ../schism/main.c: In function ‘event_loop’: ../schism/main.c:1086:1: warning: ‘noreturn’ function does return 1086 | } | ^ ``` I see no obvious reason why it's important for the compiler to be informed of event_loop()'s not returning, and right now it's just adding a false-positive warning to the build. --- include/util.h | 6 ------ schism/main.c | 1 - 2 files changed, 7 deletions(-) diff --git a/include/util.h b/include/util.h index 7092091f7..806638d33 100644 --- a/include/util.h +++ b/include/util.h @@ -53,9 +53,6 @@ # ifndef UNUSED # define UNUSED __attribute__((unused)) # endif -# ifndef NORETURN -# define NORETURN __attribute__((noreturn)) -# endif # ifndef PACKED # define PACKED __attribute__((packed)) # endif @@ -69,9 +66,6 @@ # ifndef PACKED # define PACKED # endif -# ifndef NORETURN -# define NORETURN -# endif # ifndef LIKELY # define LIKELY(x) # endif diff --git a/schism/main.c b/schism/main.c index 34d4d4c90..fed794545 100644 --- a/schism/main.c +++ b/schism/main.c @@ -594,7 +594,6 @@ static void key_event_reset(struct key_event *kk, int start_x, int start_y) kk->sy = start_y; } -static void event_loop(void) NORETURN; static void event_loop(void) { SDL_Event event;