From fc0b08e9b921b7766bed9c958445553ea4d53bc9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 5 Sep 2023 00:58:37 +0200 Subject: [PATCH] sigpipe tests: Fix -Wanalyzer-unsafe-call-within-signal-handler warning. * tests/test-sigpipe.c (handler): Invoke _exit, not exit. * tests/test-raise.c (handler): Update comments after 2020-11-25 change. --- ChangeLog | 4 ++++ tests/test-raise.c | 6 +++--- tests/test-sigpipe.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fc5f1f2fa..638449d719 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2023-09-04 Bruno Haible + sigpipe tests: Fix -Wanalyzer-unsafe-call-within-signal-handler warning. + * tests/test-sigpipe.c (handler): Invoke _exit, not exit. + * tests/test-raise.c (handler): Update comments after 2020-11-25 change. + argp: Distinguish NULL and '\0' from 0. * lib/argp-pin.c: Include . (program_invocation_short_name, program_invocation_name): Use NULL diff --git a/tests/test-raise.c b/tests/test-raise.c index 97be64dd2c..38088a53ea 100644 --- a/tests/test-raise.c +++ b/tests/test-raise.c @@ -26,9 +26,9 @@ SIGNATURE_CHECK (raise, int, (int)); #include "macros.h" -/* It is safe to use _Noreturn here: exit() never returns, and GCC knows that - exit() is a non-returning function, even on platforms where its declaration - in does not have the 'noreturn' attribute. */ +/* It is safe to use _Noreturn here: _exit() never returns, and GCC knows that + _exit() is a non-returning function, even on platforms where its declaration + in does not have the 'noreturn' attribute. */ static _Noreturn void handler (_GL_UNUSED int sig) { diff --git a/tests/test-sigpipe.c b/tests/test-sigpipe.c index ab8745b3bd..efff9d55f8 100644 --- a/tests/test-sigpipe.c +++ b/tests/test-sigpipe.c @@ -31,7 +31,7 @@ int s = SIGPIPE; static void handler (int sig) { - exit (0); + _exit (0); } int -- 2.39.5