NEWS.stable: log cherry-pick [e446f25]->[c092018] relocatable-shell: Update suggested...
[gnulib.git] / tests / test-raise.c
index 38c2353..bfe4352 100644 (file)
@@ -1,5 +1,5 @@
 /* Test raising a signal.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2014 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -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);
@@ -36,7 +39,6 @@ main (void)
 {
   /* Test behaviour for invalid argument.  */
   ASSERT (raise (-1) != 0);
-  ASSERT (raise (99) != 0);
 
   /* Test behaviour for SIGINT.  */
   ASSERT (signal (SIGINT, handler) != SIG_ERR);