]> 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>
Thu, 14 Sep 2023 10:13:50 +0000 (12:13 +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 9744fb0d3ed505fe46ca167b918b1286b1a5fe5e..6e4ba532aec157aad02aa96fa30a05b7610bef05 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: Fix gcc -Wanalyzer-use-of-uninitialized-value warning.
        * lib/argp-help.c (hol_find_entry): Access hol->entries only after
        having verified that hol->num_entries > 0.
index 7574b2b4a43a340e0769c0eef0ce2f43d87487ac..0838cab647b1d36df36d5f1c1a3dfd60975c7b49 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 (int sig)
 {
index 8a02f0c04818f63b6cf06efd9a00fa18d88c767b..231ed1e21971d11640caae82f8c498372dacf15a 100644 (file)
@@ -31,7 +31,7 @@ int s = SIGPIPE;
 static void
 handler (int sig)
 {
-  exit (0);
+  _exit (0);
 }
 
 int