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.
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
#include <dirent.h>
#include <unistd.h>
#include <stdbool.h>
-#include <stdnoreturn.h>
#if !HAVE_OPENAT
#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
#ifndef _SIGPIPE_DIE_H
#define _SIGPIPE_DIE_H
-#include <stdnoreturn.h>
-
#ifdef __cplusplus
extern "C" {
#endif
/* 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. */
# define XALLOC_H_
# include <stddef.h>
-# include <stdnoreturn.h>
# include "xalloc-oversized.h"
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));
# define XMEMDUP_H_
# include <stddef.h>
-# include <stdnoreturn.h>
# ifdef __cplusplus
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);
# include <getopt.h>
# include <inttypes.h>
-# include <stdnoreturn.h>
# ifndef _STRTOL_ERROR
enum strtol_error
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_ */
+++ /dev/null
-# 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])
-])
rmdir [test $REPLACE_UNLINKAT = 1]
save-cwd
stdbool
-stdnoreturn
sys_stat
unistd
unlink [test $REPLACE_UNLINKAT = 1]
sigpipe
sigprocmask
sigaction
-stdnoreturn
configure.ac:
+++ /dev/null
-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
+++ /dev/null
-Files:
-tests/test-stdnoreturn.c
-
-Depends-on:
-
-configure.ac:
-
-Makefile.am:
-TESTS += test-stdnoreturn
-check_PROGRAMS += test-stdnoreturn
Depends-on:
inline
-stdnoreturn
xalloc-die
xalloc-oversized
lib/xmemdup0.c
Depends-on:
-stdnoreturn
xalloc
configure.ac:
gettext-h
intprops
inttypes-incomplete
-stdnoreturn
configure.ac:
gl_XSTRTOL
+++ /dev/null
-/* 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;
-}