bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 17/19] xstrtol: use stdnoreturn.h


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

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

diff --git a/ChangeLog b/ChangeLog
index 832ca2c..aec3eb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-10  Paul Eggert  <address@hidden>
 
+       xstrtol: use stdnoreturn.h
+       * lib/xstrtol.h: Include <stdnoreturn.h>.
+       (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
+       * modules/xstrtol (Depends-on): Add stdnoreturn.
+
        xmemdup0: use stdnoreturn.h
        * lib/xmemdup0.h: Include <stdnoreturn.h>.
        (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn.
diff --git a/lib/xstrtol.h b/lib/xstrtol.h
index 716a94f..171c3ef 100644
--- a/lib/xstrtol.h
+++ b/lib/xstrtol.h
@@ -21,6 +21,7 @@
 
 # include <getopt.h>
 # include <inttypes.h>
+# include <stdnoreturn.h>
 
 # ifndef _STRTOL_ERROR
 enum strtol_error
@@ -51,12 +52,6 @@ _DECLARE_XSTRTOL (xstrtoll, long long int)
 _DECLARE_XSTRTOL (xstrtoull, unsigned long long int)
 #endif
 
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
-# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#else
-# define _GL_ATTRIBUTE_NORETURN /* empty */
-#endif
-
 /* Report an error for an invalid integer in an option argument.
 
    ERR is the error code returned by one of the xstrto* functions.
@@ -72,8 +67,8 @@ _DECLARE_XSTRTOL (xstrtoull, unsigned long long int)
 
    After reporting an error, exit with a failure status.  */
 
-void xstrtol_fatal (enum strtol_error,
-                    int, char, struct option const *,
-                    char const *) _GL_ATTRIBUTE_NORETURN;
+void noreturn xstrtol_fatal (enum strtol_error,
+                             int, char, struct option const *,
+                             char const *);
 
 #endif /* not XSTRTOL_H_ */
diff --git a/modules/xstrtol b/modules/xstrtol
index 66e5342..b7c79f1 100644
--- a/modules/xstrtol
+++ b/modules/xstrtol
@@ -15,6 +15,7 @@ getopt-gnu
 gettext-h
 intprops
 inttypes-incomplete
+stdnoreturn
 
 configure.ac:
 gl_XSTRTOL
-- 
1.7.4.4



reply via email to

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