diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-11 06:50:51 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-05-11 06:50:51 +0000 |
commit | f74abef12b1b15a349b696b7c99aced722ef21b4 (patch) | |
tree | e39c8153de84f083498305d70db90b91deed0973 /gcc | |
parent | d8bbef5c0154532ba0d2880a6e0398e02a0e831c (diff) | |
download | gcc-f74abef12b1b15a349b696b7c99aced722ef21b4.tar.gz |
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/genattr.c | 24 | ||||
-rw-r--r-- | gcc/genattrtab.c | 22 | ||||
-rw-r--r-- | gcc/gencodes.c | 24 | ||||
-rw-r--r-- | gcc/genconfig.c | 24 | ||||
-rw-r--r-- | gcc/genemit.c | 24 | ||||
-rw-r--r-- | gcc/genextract.c | 24 | ||||
-rw-r--r-- | gcc/genflags.c | 24 | ||||
-rw-r--r-- | gcc/genopinit.c | 24 | ||||
-rw-r--r-- | gcc/genoutput.c | 43 | ||||
-rw-r--r-- | gcc/genpeep.c | 24 | ||||
-rw-r--r-- | gcc/genrecog.c | 24 |
12 files changed, 249 insertions, 50 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c0e208c569..99d6cc93f46 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +Mon May 11 09:33:10 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * 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'. + Sun May 10 02:27:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * acconfig.h (HAVE_VOLATILE): Insert stub for autoconf. 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 <stdarg.h> +#else +#include <varargs.h> +#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); } diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index a1538f28090..5b73f959b41 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 <stdarg.h> #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); } 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); } diff --git a/gcc/genconfig.c b/gcc/genconfig.c index ce85c7a52d2..b01a24bfc28 100644 --- a/gcc/genconfig.c +++ b/gcc/genconfig.c @@ -21,6 +21,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" @@ -50,7 +55,7 @@ static int clobbers_seen_this_insn; static int dup_operands_seen_this_insn; char *xmalloc PROTO((unsigned)); -static void fatal (); +static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1; void fancy_abort PROTO((void)); static void walk_insn_part PROTO((rtx, int, int)); @@ -268,11 +273,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, "genconfig: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } diff --git a/gcc/genemit.c b/gcc/genemit.c index d3894716bf3..86d7a42a977 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -20,6 +20,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" @@ -31,7 +36,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. */ @@ -702,11 +707,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, "genemit: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } diff --git a/gcc/genextract.c b/gcc/genextract.c index 574a8f38b9c..288b32bcbaf 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -20,6 +20,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" @@ -100,7 +105,7 @@ static void walk_rtx PROTO ((rtx, char *)); static void print_path PROTO ((char *)); char *xmalloc PROTO ((unsigned)); char *xrealloc PROTO ((char *, unsigned)); -static void fatal (); +static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1; static char *copystr PROTO ((char *)); static void mybzero (); void fancy_abort PROTO ((void)); @@ -362,11 +367,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, "genextract: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } diff --git a/gcc/genflags.c b/gcc/genflags.c index 9a21ef0c265..d389a733e51 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.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)); /* Names for patterns. Need to allow linking with print-rtl. */ @@ -199,11 +204,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, "genflags: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } diff --git a/gcc/genopinit.c b/gcc/genopinit.c index fad369526a6..a31a444642a 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -20,6 +20,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" @@ -31,7 +36,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)); /* Many parts of GCC use arrays that are indexed by machine mode and @@ -304,11 +309,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, "genopinit: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 490ecb47c5a..9f40c85eeec 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; diff --git a/gcc/genpeep.c b/gcc/genpeep.c index 805e9efc5ae..fd3939843bb 100644 --- a/gcc/genpeep.c +++ b/gcc/genpeep.c @@ -20,6 +20,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" @@ -47,7 +52,7 @@ struct link }; char *xmalloc PROTO((unsigned)); -static void fatal (); +static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1; void fancy_abort PROTO((void)); static int max_opno; @@ -407,11 +412,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, "genpeep: "); - fprintf (stderr, s, a1, a2); + vfprintf (stderr, format, ap); + va_end (ap); fprintf (stderr, "\n"); exit (FATAL_EXIT_CODE); } diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 21a5abd8109..5fc90f36ade 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 <stdarg.h> +#else +#include <varargs.h> +#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); |