Mercurial > hg > octave-nkf > gnulib-hg
changeset 15412:7f0f3e1ac6fd
stdnoreturn, stdnoreturn-tests: remove modules
They're not needed here and a bit premature for use elsewhere. See
<http://lists.gnu.org/archive/html/bug-gnulib/2011-07/msg00209.html>.
* m4/stdnoreturn.m4, modules/stdnoreturn, modules/stdnoreturn-tests:
* tests/test-stdnoreturn.c: Remove files.
* MODULES.html.sh (_Noreturn <stdnoreturn.h>): Remove section.
* lib/openat.h, lib/sigpipe-die.h, lib/xalloc.h, lib/xmemdup0.h:
* lib/xstrtol.h: Use _Noreturn rather than including <stdnoreturn.h>
and using noreturn.
* modules/openat, modules/sigpipe-die, modules/xalloc:
* modules/xmemdup0, modules/xstrtol:
Remove dependency on stdnoreturn.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 12 Jul 2011 01:16:08 -0700 |
parents | 7b889c2a4a01 |
children | 90b622f91c85 |
files | ChangeLog MODULES.html.sh lib/openat.h lib/sigpipe-die.h lib/xalloc.h lib/xmemdup0.h lib/xstrtol.h m4/stdnoreturn.m4 modules/openat modules/sigpipe-die modules/stdnoreturn modules/stdnoreturn-tests modules/xalloc modules/xmemdup0 modules/xstrtol tests/test-stdnoreturn.c |
diffstat | 16 files changed, 21 insertions(+), 142 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2011-07-12 Paul Eggert <eggert@cs.ucla.edu> + stdnoreturn, stdnoreturn-tests: remove modules + They're not needed here and a bit premature for use elsewhere. See + <http://lists.gnu.org/archive/html/bug-gnulib/2011-07/msg00209.html>. + * m4/stdnoreturn.m4, modules/stdnoreturn, modules/stdnoreturn-tests: + * tests/test-stdnoreturn.c: Remove files. + * MODULES.html.sh (_Noreturn <stdnoreturn.h>): Remove section. + * lib/openat.h, lib/sigpipe-die.h, lib/xalloc.h, lib/xmemdup0.h: + * lib/xstrtol.h: Use _Noreturn rather than including <stdnoreturn.h> + and using noreturn. + * modules/openat, modules/sigpipe-die, modules/xalloc: + * modules/xmemdup0, modules/xstrtol: + Remove dependency on stdnoreturn. + _Noreturn: Ignore __STDC_VERSION__; observe _MSC_VER. * build-aux/_Noreturn.h (_Noreturn): Ignore __STDC_VERSION__. Reparenthesize to avoid GCC warning.
--- a/MODULES.html.sh +++ b/MODULES.html.sh @@ -2321,16 +2321,6 @@ func_module _Noreturn func_end_table - element="_Noreturn <stdnoreturn.h>" - element=`printf "%s" "$element" | sed -e "$sed_lt" -e "$sed_gt"` - func_section_wrap c1x_sup_stdnoreturn - func_wrap H3 - func_echo "$element" - - func_begin_table - func_module stdnoreturn - func_end_table - element="Support for obsolete systems lacking POSIX:2008" func_section_wrap posix_sup_obsolete func_wrap H2
--- a/lib/openat.h +++ b/lib/openat.h @@ -26,7 +26,6 @@ #include <dirent.h> #include <unistd.h> #include <stdbool.h> -#include <stdnoreturn.h> #if !HAVE_OPENAT @@ -42,8 +41,8 @@ #endif -noreturn void openat_restore_fail (int); -noreturn void openat_save_fail (int); +_Noreturn void openat_restore_fail (int); +_Noreturn void openat_save_fail (int); /* Using these function names makes application code slightly more readable than it would be with
--- a/lib/sigpipe-die.h +++ b/lib/sigpipe-die.h @@ -41,8 +41,6 @@ #ifndef _SIGPIPE_DIE_H #define _SIGPIPE_DIE_H -#include <stdnoreturn.h> - #ifdef __cplusplus extern "C" { #endif @@ -50,7 +48,7 @@ /* Emit an error message indicating a SIGPIPE signal, and terminate the process with an error code. */ -extern noreturn void sigpipe_die (void); +extern _Noreturn void sigpipe_die (void); /* Install a SIGPIPE handler that invokes PREPARE_DIE and then emits an error message and exits. PREPARE_DIE may be NULL, meaning a no-op. */
--- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -19,7 +19,6 @@ # define XALLOC_H_ # include <stddef.h> -# include <stdnoreturn.h> # include "xalloc-oversized.h" @@ -45,7 +44,7 @@ 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 noreturn void xalloc_die (void); +extern _Noreturn void xalloc_die (void); void *xmalloc (size_t s) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
--- a/lib/xmemdup0.h +++ b/lib/xmemdup0.h @@ -19,7 +19,6 @@ # define XMEMDUP_H_ # include <stddef.h> -# include <stdnoreturn.h> # ifdef __cplusplus @@ -31,7 +30,7 @@ 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 noreturn void xalloc_die (void); +extern _Noreturn void xalloc_die (void); char *xmemdup0 (void const *p, size_t s);
--- a/lib/xstrtol.h +++ b/lib/xstrtol.h @@ -21,7 +21,6 @@ # include <getopt.h> # include <inttypes.h> -# include <stdnoreturn.h> # ifndef _STRTOL_ERROR enum strtol_error @@ -67,8 +66,8 @@ After reporting an error, exit with a failure status. */ -void noreturn xstrtol_fatal (enum strtol_error, - int, char, struct option const *, - char const *); +void _Noreturn xstrtol_fatal (enum strtol_error, + int, char, struct option const *, + char const *); #endif /* not XSTRTOL_H_ */
deleted file mode 100644 --- a/m4/stdnoreturn.m4 +++ /dev/null @@ -1,22 +0,0 @@ -# Check for stdnoreturn.h. - -dnl Copyright 2011 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -AC_DEFUN([gl_STDNORETURN_H], -[ - dnl Assume that a system-supplied stdnoreturn.h works if it exists. - AC_CHECK_HEADERS_ONCE([stdnoreturn.h]) - - if test "$ac_cv_header_stdnoreturn_h" = yes; then - STDNORETURN_H='' - else - STDNORETURN_H='stdnoreturn.h' - fi - AC_SUBST([STDNORETURN_H]) - - AM_CONDITIONAL([GL_GENERATE_STDNORETURN_H], - [test $ac_cv_header_stdnoreturn_h != yes]) -])
--- a/modules/openat +++ b/modules/openat @@ -32,7 +32,6 @@ rmdir [test $REPLACE_UNLINKAT = 1] save-cwd stdbool -stdnoreturn sys_stat unistd unlink [test $REPLACE_UNLINKAT = 1]
--- a/modules/sigpipe-die +++ b/modules/sigpipe-die @@ -12,7 +12,6 @@ sigpipe sigprocmask sigaction -stdnoreturn configure.ac:
deleted file mode 100644 --- a/modules/stdnoreturn +++ /dev/null @@ -1,34 +0,0 @@ -Description: -A <stdnoreturn.h> that conforms to C1X. - -Files: -m4/stdnoreturn.m4 - -Depends-on: -_Noreturn - -configure.ac: -gl_STDNORETURN_H - -Makefile.am: -BUILT_SOURCES += $(STDNORETURN_H) - -# Create <stdnoreturn.h> when the system doesn't have one that works. -if GL_GENERATE_STDNORETURN_H -stdnoreturn.h: $(top_builddir)/config.status $(_NORETURN_H) - { cat $(_NORETURN_H) && echo '#define noreturn _Noreturn'; } > $@-t - mv $@-t $@ -else -stdnoreturn.h: $(top_builddir)/config.status - rm -f $@ -endif -MOSTLYCLEANFILES += stdnoreturn.h - -Include: -<stdnoreturn.h> - -License: -LGPLv2+ - -Maintainer: -all
deleted file mode 100644 --- a/modules/stdnoreturn-tests +++ /dev/null @@ -1,10 +0,0 @@ -Files: -tests/test-stdnoreturn.c - -Depends-on: - -configure.ac: - -Makefile.am: -TESTS += test-stdnoreturn -check_PROGRAMS += test-stdnoreturn
--- a/modules/xalloc +++ b/modules/xalloc @@ -8,7 +8,6 @@ Depends-on: inline -stdnoreturn xalloc-die xalloc-oversized
--- a/modules/xmemdup0 +++ b/modules/xmemdup0 @@ -6,7 +6,6 @@ lib/xmemdup0.c Depends-on: -stdnoreturn xalloc configure.ac:
--- a/modules/xstrtol +++ b/modules/xstrtol @@ -15,7 +15,6 @@ gettext-h intprops inttypes-incomplete -stdnoreturn configure.ac: gl_XSTRTOL
deleted file mode 100644 --- a/tests/test-stdnoreturn.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Test of <stdnoreturn.h> and _Noreturn. - Copyright 2011 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 - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* written by Paul Eggert */ - -#include <config.h> - -#include <stdnoreturn.h> - -/* But did he ever return? No he never returned, - And his fate is still unlearned ... */ -static noreturn void MTA (void); - -static _Noreturn void -Charlie (void) -{ - MTA (); -} - -static void -MTA (void) -{ - Charlie (); -} - -int -main (int argc, char **argv) -{ - if (argc <= 0) - MTA (); - if (!argv[0][0]) - Charlie (); - return 0; -}