[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/19] stdlib: use _Noreturn
From: |
Paul Eggert |
Subject: |
[PATCH 06/19] stdlib: use _Noreturn |
Date: |
Sun, 10 Jul 2011 22:22:34 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 |
* lib/stdlib.in.h (_GL_ATTRIBUTE_NORETURN): Remove.
(_Exit): Use _Noreturn rather than _GL_ATTRIBUTE_NORETURN.
* modules/stdlib (Depends-on): Add _Noreturn.
(stdlib.h): Depend on $(_NORETURN_H), and copy it in.
---
ChangeLog | 6 ++++++
lib/stdlib.in.h | 8 ++------
modules/stdlib | 5 ++++-
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 315c650..12bffcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-07-10 Paul Eggert <address@hidden>
+ stdlib: use _Noreturn
+ * lib/stdlib.in.h (_GL_ATTRIBUTE_NORETURN): Remove.
+ (_Exit): Use _Noreturn rather than _GL_ATTRIBUTE_NORETURN.
+ * modules/stdlib (Depends-on): Add _Noreturn.
+ (stdlib.h): Depend on $(_NORETURN_H), and copy it in.
+
stdnoreturn-tests: new module
* modules/stdnoreturn-tests, tests/test-stdnoreturn.c: New files.
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 62a2ce9..047fac1 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -89,11 +89,7 @@ struct random_data
# include <unistd.h>
#endif
-#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
-# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
-#else
-# define _GL_ATTRIBUTE_NORETURN
-#endif
+/* The definition of _Noreturn is copied here. */
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
@@ -120,7 +116,7 @@ struct random_data
/* Terminate the current process with the given return code, without running
the 'atexit' handlers. */
# if address@hidden@
-_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
_GL_CXXALIASWARN (_Exit);
diff --git a/modules/stdlib b/modules/stdlib
index 473b46a..0ec07fb 100644
--- a/modules/stdlib
+++ b/modules/stdlib
@@ -6,6 +6,7 @@ lib/stdlib.in.h
m4/stdlib_h.m4
Depends-on:
+_Noreturn
arg-nonnull
c++defs
include_next
@@ -21,7 +22,8 @@ BUILT_SOURCES += stdlib.h
# We need the following in order to create <stdlib.h> when the system
# doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H)
$(ARG_NONNULL_H) $(WARN_ON_USE_H)
+stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+ $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f address@hidden $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
@@ -95,6 +97,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ -e '/definition of _Noreturn/r $(_NORETURN_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
} > address@hidden && \
--
1.7.4.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 06/19] stdlib: use _Noreturn,
Paul Eggert <=