From f74abef12b1b15a349b696b7c99aced722ef21b4 Mon Sep 17 00:00:00 2001 From: ghazi Date: Mon, 11 May 1998 06:50:51 +0000 Subject: * 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'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19661 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/genattr.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'gcc/genattr.c') diff --git a/gcc/genattr.c b/gcc/genattr.c index 58e99307b6c..c50e0fd45c5 100644 --- a/gcc/genattr.c +++ b/gcc/genattr.c @@ -21,6 +21,11 @@ Boston, MA 02111-1307, USA. */ #include "hconfig.h" +#ifdef __STDC__ +#include +#else +#include +#endif #include "system.h" #include "rtl.h" #include "obstack.h" @@ -32,7 +37,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. */ @@ -221,11 +226,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, "genattr: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } -- cgit v1.2.1