From 320e7c40e730e7b6ab8346b4cc41989a9031c28d Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Mon, 11 May 1998 06:50:51 +0000 Subject: 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 --- gcc/genrecog.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'gcc/genrecog.c') diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 21a5abd..5fc90f36 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -47,6 +47,11 @@ Boston, MA 02111-1307, USA. */ it returns the split rtl in a SEQUENCE. */ #include "hconfig.h" +#ifdef __STDC__ +#include +#else +#include +#endif #include "system.h" #include "rtl.h" #include "obstack.h" @@ -191,7 +196,7 @@ static void change_state PROTO((char *, char *, int)); static char *copystr PROTO((char *)); static void mybzero PROTO((char *, unsigned)); static void mybcopy PROTO((char *, char *, unsigned)); -static void fatal PROTO((char *)); +static void fatal PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; char *xrealloc PROTO((char *, unsigned)); char *xmalloc PROTO((unsigned)); void fancy_abort PROTO((void)); @@ -1669,11 +1674,22 @@ xmalloc (size) } static void -fatal (s) - 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, "genrecog: "); - fprintf (stderr, s); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); fprintf (stderr, "after %d definitions\n", next_index); exit (FATAL_EXIT_CODE); -- cgit v1.1