summaryrefslogtreecommitdiff
path: root/gcc/gencodes.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-05-11 06:50:51 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-05-11 06:50:51 +0000
commit320e7c40e730e7b6ab8346b4cc41989a9031c28d (patch)
treee39c8153de84f083498305d70db90b91deed0973 /gcc/gencodes.c
parentce4a03916c76227660f5d388bd93c221185cfd24 (diff)
downloadgcc-320e7c40e730e7b6ab8346b4cc41989a9031c28d.tar.gz
genattr.c: Include stdarg.h/varargs.h.
* genattr.c: Include stdarg.h/varargs.h. Change function `fatal' to use variable arguments instead of faking it with integer parameters. Provide a prototype which also checks the format specifiers using ATTRIBUTE_PRINTF_1. * genattrtab.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * genopinit.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * genoutput.c: Likewise. Similarly for function `error'. From-SVN: r19661
Diffstat (limited to 'gcc/gencodes.c')
-rw-r--r--gcc/gencodes.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index c74ae0a6e9f..a3aa1fe2df1 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -23,6 +23,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h"
+#ifdef __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
#include "system.h"
#include "rtl.h"
#include "obstack.h"
@@ -34,7 +39,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free
char *xmalloc PROTO((unsigned));
-static void fatal ();
+static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */
@@ -79,11 +84,22 @@ xrealloc (ptr, size)
}
static void
-fatal (s, a1, a2)
- char *s;
+fatal VPROTO ((char *format, ...))
{
+#ifndef __STDC__
+ char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char *);
+#endif
+
fprintf (stderr, "gencodes: ");
- fprintf (stderr, s, a1, a2);
+ vfprintf (stderr, format, ap);
+ va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
}