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/genattrtab.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'gcc/genattrtab.c') diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index a1538f2..5b73f95 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -96,7 +96,7 @@ Boston, MA 02111-1307, USA. */ #include "hconfig.h" -/* varargs must always be included after *config.h. */ +/* varargs must always be included after *config.h, but before stdio.h. */ #ifdef __STDC__ #include #else @@ -125,7 +125,7 @@ struct obstack *temp_obstack = &obstack2; /* Define this so we can link with print-rtl.o to get debug_rtx function. */ char **insn_name_ptr = 0; -static void fatal (); +static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1; void fancy_abort PROTO((void)); /* enough space to reserve for printing out ints */ @@ -5769,12 +5769,22 @@ copy_rtx_unchanging (orig) } static void -fatal (s, a1, a2) - char *s; - char *a1, *a2; +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, "genattrtab: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } -- cgit v1.1