bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 18/19] xalloc: use stdnoreturn.h


From: Paul Eggert
Subject: [PATCH 18/19] xalloc: use stdnoreturn.h
Date: Sun, 10 Jul 2011 22:29:51 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10

* lib/xalloc.h: Include <stdnoreturn.h>.
(_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
* modules/xalloc (Depends-on): Add stdnoreturn.
---
 ChangeLog      |    5 +++++
 lib/xalloc.h   |    9 ++-------
 modules/xalloc |    1 +
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index aec3eb1..08f011c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-10  Paul Eggert  <address@hidden>
 
+       xalloc: use stdnoreturn.h
+       * lib/xalloc.h: Include <stdnoreturn.h>.
+       (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
+       * modules/xalloc (Depends-on): Add stdnoreturn.
+
        xstrtol: use stdnoreturn.h
        * lib/xstrtol.h: Include <stdnoreturn.h>.
        (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
diff --git a/lib/xalloc.h b/lib/xalloc.h
index c1bbe7e..7dbcc79 100644
--- a/lib/xalloc.h
+++ b/lib/xalloc.h
@@ -19,6 +19,7 @@
 # define XALLOC_H_
 
 # include <stddef.h>
+# include <stdnoreturn.h>
 
 # include "xalloc-oversized.h"
 
@@ -27,12 +28,6 @@ extern "C" {
 # endif
 
 
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-#  define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-# else
-#  define _GL_ATTRIBUTE_NORETURN /* empty */
-# endif
-
 # if __GNUC__ >= 3
 #  define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
 # else
@@ -50,7 +45,7 @@ extern "C" {
    or by using gnulib's xalloc-die module.  This is the
    function to call when one wants the program to die because of a
    memory allocation failure.  */
-extern void xalloc_die (void) _GL_ATTRIBUTE_NORETURN;
+extern noreturn void xalloc_die (void);
 
 void *xmalloc (size_t s)
       _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
diff --git a/modules/xalloc b/modules/xalloc
index 19e7a0b..e96d057 100644
--- a/modules/xalloc
+++ b/modules/xalloc
@@ -8,6 +8,7 @@ m4/xalloc.m4
 
 Depends-on:
 inline
+stdnoreturn
 xalloc-die
 xalloc-oversized
 
-- 
1.7.4.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]