]> Savannah Git Hosting - gnulib.git/commitdiff
raise-tests: avoid GCC 11's new exit-from-signal-handler warning
authorJim Meyering <meyering@fb.com>
Thu, 26 Nov 2020 02:06:36 +0000 (18:06 -0800)
committerJim Meyering <meyering@fb.com>
Thu, 26 Nov 2020 02:06:36 +0000 (18:06 -0800)
gcc's -Wanalyzer-unsafe-call-within-signal-handler exposed this.
* tests/test-raise.c: Include unistd.h.
(handler): Use _exit, not exit.

ChangeLog
tests/test-raise.c

index 7dbd31739d45cb64cc3552494a2e961a3da4a27d..bb3e664becabd027c5ba2002da679027fd9028a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-11-25  Jim Meyering  <meyering@fb.com>
+
+       raise-tests: avoid GCC 11's new exit-from-signal-handler warning
+       gcc's -Wanalyzer-unsafe-call-within-signal-handler exposed this.
+       * tests/test-raise.c: Include unistd.h.
+       (handler): Use _exit, not exit.
+
 2020-11-23  Bruno Haible  <bruno@clisp.org>
 
        Use the correct printf format attribute for mingw.
index 9135623294e903a2a221e458db46787dae63cf1d..b71bd5a540a8790f28bd2d48511d99e1a686a834 100644 (file)
@@ -17,6 +17,7 @@
 #include <config.h>
 
 #include <signal.h>
+#include <unistd.h>
 
 #include "signature.h"
 SIGNATURE_CHECK (raise, int, (int));
@@ -31,7 +32,7 @@ SIGNATURE_CHECK (raise, int, (int));
 static _Noreturn void
 handler (int sig)
 {
-  exit (0);
+  _exit (0);
 }
 
 int