From: Paul Eggert Date: Tue, 12 Jul 2011 08:11:41 +0000 (-0700) Subject: xalloc: use stdnoreturn.h X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a046525c54d375ff2b3d9d0f8c78f5c779ce4f99;p=pspp xalloc: use stdnoreturn.h * lib/xalloc.h: Include . (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. * modules/xalloc (Depends-on): Add stdnoreturn. --- diff --git a/ChangeLog b/ChangeLog index 0265180684..e555f5a9fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-07-12 Paul Eggert + xalloc: use stdnoreturn.h + * lib/xalloc.h: Include . + (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. + * modules/xalloc (Depends-on): Add stdnoreturn. + xstrtol: use stdnoreturn.h * lib/xstrtol.h: Include . (_GL_ATTRIBUTE_NORETURN): Remove; all uses replaced with noreturn. diff --git a/lib/xalloc.h b/lib/xalloc.h index c1bbe7e5b6..7dbcc79bb3 100644 --- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -19,6 +19,7 @@ # define XALLOC_H_ # include +# include # 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 19e7a0b93e..e96d0574c4 100644 --- a/modules/xalloc +++ b/modules/xalloc @@ -8,6 +8,7 @@ m4/xalloc.m4 Depends-on: inline +stdnoreturn xalloc-die xalloc-oversized