]> Savannah Git Hosting - gnulib.git/commitdiff
sigpipe tests: Fix -Wanalyzer-unsafe-call-within-signal-handler warning.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 22:58:37 +0000 (00:58 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 22:58:37 +0000 (00:58 +0200)
* tests/test-sigpipe.c (handler): Invoke _exit, not exit.
* tests/test-raise.c (handler): Update comments after 2020-11-25 change.

ChangeLog
tests/test-raise.c
tests/test-sigpipe.c

index 1fc5f1f2fa0e822b62c3ea6a4580b87c1aef95ef..638449d7196bb563cad2e15d9496dc961b949c2d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-09-04  Bruno Haible  <bruno@clisp.org>
 
+       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 <stddef.h>.
        (program_invocation_short_name, program_invocation_name): Use NULL
index 97be64dd2ce7416553e582a2b5463ca27b4d71fa..38088a53ea50867470911b2f7b81730c1463dc58 100644 (file)
@@ -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 <stdlib.h> 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 <unistd.h> does not have the 'noreturn' attribute.  */
 static _Noreturn void
 handler (_GL_UNUSED int sig)
 {
index ab8745b3bd9e5d7489b41666b38d4b820378c1b2..efff9d55f83894a4d9c329b441479617f9aa2199 100644 (file)
@@ -31,7 +31,7 @@ int s = SIGPIPE;
 static void
 handler (int sig)
 {
-  exit (0);
+  _exit (0);
 }
 
 int