raise tests: Avoid a GCC warning.
authorBernhard Voelker <mail@bernhard-voelker.de>
Fri, 7 Oct 2011 09:37:31 +0000 (11:37 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 7 Oct 2011 09:37:31 +0000 (11:37 +0200)
* tests/test-raise.c (handler): Use _Noreturn.

ChangeLog
tests/test-raise.c

index e21b9ef..e3ef62d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-07  Bernhard Voelker  <mail@bernhard-voelker.de>
+
+       raise tests: Avoid a GCC warning.
+       * tests/test-raise.c (handler): Use _Noreturn.
+
 2011-10-07  Bruno Haible  <bruno@clisp.org>
 
        Tests for module 'ldexpf'.
index 38c2353..85d076e 100644 (file)
@@ -25,7 +25,10 @@ SIGNATURE_CHECK (raise, int, (int));
 
 #include "macros.h"
 
-static void
+/* 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.  */
+static _Noreturn void
 handler (int sig)
 {
   exit (0);