Commit 320e7c40 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent ce4a0391
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> Sun May 10 02:27:03 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* acconfig.h (HAVE_VOLATILE): Insert stub for autoconf. * acconfig.h (HAVE_VOLATILE): Insert stub for autoconf.
......
...@@ -21,6 +21,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -32,7 +37,7 @@ struct obstack *rtl_obstack = &obstack; ...@@ -32,7 +37,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free #define obstack_chunk_free free
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
...@@ -221,11 +226,22 @@ xrealloc (ptr, size) ...@@ -221,11 +226,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genattr: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -96,7 +96,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -96,7 +96,7 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #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__ #ifdef __STDC__
#include <stdarg.h> #include <stdarg.h>
#else #else
...@@ -125,7 +125,7 @@ struct obstack *temp_obstack = &obstack2; ...@@ -125,7 +125,7 @@ struct obstack *temp_obstack = &obstack2;
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
char **insn_name_ptr = 0; char **insn_name_ptr = 0;
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
/* enough space to reserve for printing out ints */ /* enough space to reserve for printing out ints */
...@@ -5769,12 +5769,22 @@ copy_rtx_unchanging (orig) ...@@ -5769,12 +5769,22 @@ copy_rtx_unchanging (orig)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
char *a1, *a2;
{ {
#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, "genattrtab: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -23,6 +23,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,6 +23,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -34,7 +39,7 @@ struct obstack *rtl_obstack = &obstack; ...@@ -34,7 +39,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free #define obstack_chunk_free free
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
...@@ -79,11 +84,22 @@ xrealloc (ptr, size) ...@@ -79,11 +84,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "gencodes: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -21,6 +21,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -21,6 +21,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -50,7 +55,7 @@ static int clobbers_seen_this_insn; ...@@ -50,7 +55,7 @@ static int clobbers_seen_this_insn;
static int dup_operands_seen_this_insn; static int dup_operands_seen_this_insn;
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
static void walk_insn_part PROTO((rtx, int, int)); static void walk_insn_part PROTO((rtx, int, int));
...@@ -268,11 +273,22 @@ xrealloc (ptr, size) ...@@ -268,11 +273,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genconfig: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -31,7 +36,7 @@ struct obstack *rtl_obstack = &obstack; ...@@ -31,7 +36,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free #define obstack_chunk_free free
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
/* Define this so we can link with print-rtl.o to get debug_rtx function. */ /* Define this so we can link with print-rtl.o to get debug_rtx function. */
...@@ -702,11 +707,22 @@ xrealloc (ptr, size) ...@@ -702,11 +707,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genemit: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -100,7 +105,7 @@ static void walk_rtx PROTO ((rtx, char *)); ...@@ -100,7 +105,7 @@ static void walk_rtx PROTO ((rtx, char *));
static void print_path PROTO ((char *)); static void print_path PROTO ((char *));
char *xmalloc PROTO ((unsigned)); char *xmalloc PROTO ((unsigned));
char *xrealloc PROTO ((char *, unsigned)); char *xrealloc PROTO ((char *, unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
static char *copystr PROTO ((char *)); static char *copystr PROTO ((char *));
static void mybzero (); static void mybzero ();
void fancy_abort PROTO ((void)); void fancy_abort PROTO ((void));
...@@ -362,11 +367,22 @@ xrealloc (ptr, size) ...@@ -362,11 +367,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genextract: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -23,6 +23,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -23,6 +23,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -34,7 +39,7 @@ struct obstack *rtl_obstack = &obstack; ...@@ -34,7 +39,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free #define obstack_chunk_free free
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
/* Names for patterns. Need to allow linking with print-rtl. */ /* Names for patterns. Need to allow linking with print-rtl. */
...@@ -199,11 +204,22 @@ xrealloc (ptr, size) ...@@ -199,11 +204,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genflags: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -31,7 +36,7 @@ struct obstack *rtl_obstack = &obstack; ...@@ -31,7 +36,7 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free #define obstack_chunk_free free
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
/* Many parts of GCC use arrays that are indexed by machine mode and /* Many parts of GCC use arrays that are indexed by machine mode and
...@@ -304,11 +309,22 @@ xrealloc (ptr, size) ...@@ -304,11 +309,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genopinit: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -91,6 +91,11 @@ It would not make an case in output_insn_hairy because the template ...@@ -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 `*'). */ given in the entry is a constant (it does not start with `*'). */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -108,9 +113,9 @@ struct obstack *rtl_obstack = &obstack; ...@@ -108,9 +113,9 @@ struct obstack *rtl_obstack = &obstack;
#define obstack_chunk_free free #define obstack_chunk_free free
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
static void error (); static void error PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
static void mybcopy (); static void mybcopy ();
static void mybzero (); static void mybzero ();
static int n_occurrences PROTO((int, char *)); static int n_occurrences PROTO((int, char *));
...@@ -922,11 +927,22 @@ mybcopy (b1, b2, length) ...@@ -922,11 +927,22 @@ mybcopy (b1, b2, length)
} }
static void static void
fatal (s, a1, a2, a3, a4) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genoutput: ");
fprintf (stderr, s, a1, a2, a3, a4); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
...@@ -941,11 +957,22 @@ fancy_abort () ...@@ -941,11 +957,22 @@ fancy_abort ()
} }
static void static void
error (s, a1, a2) error VPROTO ((char *format, ...))
char *s;
{ {
#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, "genoutput: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
have_error = 1; have_error = 1;
......
...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,6 +20,11 @@ Boston, MA 02111-1307, USA. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -47,7 +52,7 @@ struct link ...@@ -47,7 +52,7 @@ struct link
}; };
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
static void fatal (); static void fatal PVPROTO ((char *, ...)) ATTRIBUTE_PRINTF_1;
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
static int max_opno; static int max_opno;
...@@ -407,11 +412,22 @@ xrealloc (ptr, size) ...@@ -407,11 +412,22 @@ xrealloc (ptr, size)
} }
static void static void
fatal (s, a1, a2) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genpeep: ");
fprintf (stderr, s, a1, a2); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
......
...@@ -47,6 +47,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,6 +47,11 @@ Boston, MA 02111-1307, USA. */
it returns the split rtl in a SEQUENCE. */ it returns the split rtl in a SEQUENCE. */
#include "hconfig.h" #include "hconfig.h"
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "system.h" #include "system.h"
#include "rtl.h" #include "rtl.h"
#include "obstack.h" #include "obstack.h"
...@@ -191,7 +196,7 @@ static void change_state PROTO((char *, char *, int)); ...@@ -191,7 +196,7 @@ static void change_state PROTO((char *, char *, int));
static char *copystr PROTO((char *)); static char *copystr PROTO((char *));
static void mybzero PROTO((char *, unsigned)); static void mybzero PROTO((char *, unsigned));
static void mybcopy PROTO((char *, 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 *xrealloc PROTO((char *, unsigned));
char *xmalloc PROTO((unsigned)); char *xmalloc PROTO((unsigned));
void fancy_abort PROTO((void)); void fancy_abort PROTO((void));
...@@ -1669,11 +1674,22 @@ xmalloc (size) ...@@ -1669,11 +1674,22 @@ xmalloc (size)
} }
static void static void
fatal (s) fatal VPROTO ((char *format, ...))
char *s;
{ {
#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, "genrecog: ");
fprintf (stderr, s); vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
fprintf (stderr, "after %d definitions\n", next_index); fprintf (stderr, "after %d definitions\n", next_index);
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment