changeset 4642:9f5b3245e524

Remove K&R cruft.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 09 Sep 2003 06:37:10 +0000
parents 751a553227be
children 6ad23581140d
files lib/fatal.c m4/fatal.m4
diffstat 2 files changed, 13 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/lib/fatal.c
+++ b/lib/fatal.c
@@ -22,22 +22,12 @@
 
 /* FIXME: define EXIT_FAILURE */
 
-#include <stdio.h>
+#include "fatal.h"
 
-#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start(args, lastarg)
-#else
-# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
-# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
-#endif
-
-#if STDC_HEADERS || _LIBC
-# include <stdlib.h>
-# include <string.h>
-#else
-void exit ();
-#endif
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #ifdef _LIBC
 # define program_name program_invocation_name
@@ -47,24 +37,14 @@
 extern char *program_name;
 #endif
 
-#include "fatal.h"
 #include "unlocked-io.h"
 
 /* Like error, but always exit with EXIT_FAILURE.  */
 
 void
-#if defined VA_START && __STDC__
 fatal (int errnum, const char *message, ...)
-#else
-fatal (errnum, message, va_alist)
-     int errnum;
-     char *message;
-     va_dcl
-#endif
 {
-#ifdef VA_START
   va_list args;
-#endif
 
   if (error_print_progname)
     (*error_print_progname) ();
@@ -74,11 +54,10 @@
       fprintf (stderr, "%s: ", program_name);
     }
 
-#ifdef VA_START
-  VA_START (args, message);
+  va_start (args, message);
   error (EXIT_FAILURE, errnum, message, args);
+
+  /* The following code isn't reachable, but pacifies some compilers.  */
   va_end (args);
-#else
-  error (EXIT_FAILURE, errnum, message, a1, a2, a3, a4, a5, a6, a7, a8);
-#endif
+  abort ();
 }
--- a/m4/fatal.m4
+++ b/m4/fatal.m4
@@ -1,14 +1,10 @@
-# fatal.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# fatal.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
 dnl that contains a configuration script generated by Autoconf, under
 dnl the same distribution terms as the rest of that program.
 
-AC_DEFUN([gl_FATAL],
-[
-  dnl Prerequisites of lib/fatal.c.
-  AC_REQUIRE([AC_HEADER_STDC])
-  AC_CHECK_FUNCS_ONCE(doprnt vprintf)
-])
+dnl Prerequisites of lib/fatal.c.
+AC_DEFUN([gl_FATAL], [:])