From: Bruno Haible Date: Mon, 4 Sep 2023 22:58:37 +0000 (+0200) Subject: sigpipe tests: Fix -Wanalyzer-unsafe-call-within-signal-handler warning. X-Git-Tag: v1.0~819 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=fc0b08e9b921b7766bed9c958445553ea4d53bc9;p=gnulib.git 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. --- 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