diff options
Diffstat (limited to 'gcc/genoutput.c')
-rw-r--r-- | gcc/genoutput.c | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 490ecb4..9f40c85 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -91,6 +91,11 @@ It would not make an case in output_insn_hairy because the template given in the entry is a constant (it does not start with `*'). */ #include "hconfig.h" +#ifdef __STDC__ +#include <stdarg.h> +#else +#include <varargs.h> +#endif #include "system.h" #include "rtl.h" #include "obstack.h" @@ -108,9 +113,9 @@ 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)); -static void error (); +static void error PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1; static void mybcopy (); static void mybzero (); static int n_occurrences PROTO((int, char *)); @@ -922,11 +927,22 @@ mybcopy (b1, b2, length) } static void -fatal (s, a1, a2, a3, a4) - 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, "genoutput: "); - fprintf (stderr, s, a1, a2, a3, a4); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } @@ -941,11 +957,22 @@ fancy_abort () } static void -error (s, a1, a2) - char *s; +error 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, "genoutput: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); have_error = 1; |