aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-05-11 06:50:51 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-05-11 06:50:51 +0000
commit320e7c40e730e7b6ab8346b4cc41989a9031c28d (patch)
treee39c8153de84f083498305d70db90b91deed0973 /gcc
parentce4a03916c76227660f5d388bd93c221185cfd24 (diff)
downloadgcc-320e7c40e730e7b6ab8346b4cc41989a9031c28d.zip
gcc-320e7c40e730e7b6ab8346b4cc41989a9031c28d.tar.gz
gcc-320e7c40e730e7b6ab8346b4cc41989a9031c28d.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog18
-rw-r--r--gcc/genattr.c24
-rw-r--r--gcc/genattrtab.c22
-rw-r--r--gcc/gencodes.c24
-rw-r--r--gcc/genconfig.c24
-rw-r--r--gcc/genemit.c24
-rw-r--r--gcc/genextract.c24
-rw-r--r--gcc/genflags.c24
-rw-r--r--gcc/genopinit.c24
-rw-r--r--gcc/genoutput.c43
-rw-r--r--gcc/genpeep.c24
-rw-r--r--gcc/genrecog.c24
12 files changed, 249 insertions, 50 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3c0e208..99d6cc9 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 58e9930..c50e0fd 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 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 <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 c74ae0a..a3aa1fe 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 ce85c7a..b01a24bf 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 d389471..86d7a42 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 574a8f3..288b32b 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 9a21ef0..d389a73 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 fad3695..a31a444 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 490ecb47..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;
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index 805e9ef..fd39398 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 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 <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);