Message ID | 20230605175647.88395-6-philmd@linaro.org |
---|---|
State | New |
Headers | show |
Series | bulk: Do not declare function prototypes using 'extern' keyword | expand |
On 6/5/23 10:56, Philippe Mathieu-Daudé wrote: > -static __attribute__((noreturn)) void exit_failure(void) > +static G_NORETURN void exit_failure(void) I think attr-spec-seq ('[[noreturn]]') has to come before specifiers-and-qualifiers (i.e. 'static'). To me this means that G_NORETURN being redefined from __attribute__((noreturn)) to [[noreturn]] was a glib bug, since it has a different syntax. Therefore we should simply avoid G_NORETURN entirely. At some point we should be able to update -to --std=c23, at which point we use [[noreturn]] directly and not G_NORETURN anyway. r~
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index f8e300d302..fb076a6eb9 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -67,7 +67,7 @@ extern "C" { * which gets linked automatically. */ int __mingw_setjmp(jmp_buf); -void __attribute__((noreturn)) __mingw_longjmp(jmp_buf, int); +G_NORETURN void __mingw_longjmp(jmp_buf, int); #define setjmp(env) __mingw_setjmp(env) #define longjmp(env, val) __mingw_longjmp(env, val) #elif defined(_WIN64) diff --git a/tests/migration/stress.c b/tests/migration/stress.c index 88acf8dc25..54a95c07f1 100644 --- a/tests/migration/stress.c +++ b/tests/migration/stress.c @@ -36,7 +36,7 @@ static int gettid(void) } #endif -static __attribute__((noreturn)) void exit_failure(void) +static G_NORETURN void exit_failure(void) { if (getpid() == 1) { sync();