contain debugging information specified by the GNU compiler
in the form of comments (the mips assembler does not support
assembly access to debug information).
- Contributed by: Michael Meissner, meissner@osf.org
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
-
+ Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc.
+ Contributed by Michael Meissner, meissner@osf.org
+
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
*/
\f
+#ifdef __STDC__
+#include "gstdarg.h"
+#else
#include "gvarargs.h"
+#endif
#include "config.h"
#include <stdio.h>
typedef void *PTR_T;
typedef const void *CPTR_T;
#define __proto(x) x
+#define VPROTO(ARGS) ARGS
+#define VA_START(va_list,var) va_start(va_list,var)
#else
#if defined(_STDIO_H_) || defined(__STDIO_H__) /* Ultrix 4.0, SGI */
#define __proto(x) ()
#define const
+#define VPROTO(ARGS) (va_alist) va_dcl
+#define VA_START(va_list,var) va_start(va_list)
#endif
/* Do to size_t being defined in sys/types.h and different
extern PTR_T xrealloc __proto((PTR_T, Size_t));
extern void xfree __proto((PTR_T));
-extern void fatal(); /* can't use prototypes here */
-extern void error();
+extern void fatal __proto((char *format, ...));
+extern void error __proto((char *format, ...));
\f
#ifndef MIPS_DEBUGGING_INFO
/*VARARGS*/
void
-fatal (va_alist)
- va_dcl
+fatal VPROTO((char *format, ...))
{
- va_list ap;
+#ifndef __STDC__
char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char*);
+#endif
if (line_number > 0)
fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
else
fprintf (stderr, "%s:", progname);
- va_start(ap);
- format = va_arg (ap, char *);
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
/*VARARGS*/
void
-error (va_alist)
- va_dcl
+error VPROTO((char *format, ...))
{
- va_list ap;
+#ifndef __STDC__
char *format;
+#endif
+ va_list ap;
+
+ VA_START (ap, format);
+
+#ifndef __STDC__
+ format = va_arg (ap, char*);
+#endif
if (line_number > 0)
fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
else
fprintf (stderr, "%s:", progname);
- va_start(ap);
- format = va_arg (ap, char *);
vfprintf (stderr, format, ap);
fprintf (stderr, "\n");
if (line_number > 0)
Error messages and low-level interface to malloc also handled here. */
#include "config.h"
+#ifdef __STDC__
+#include "gstdarg.h"
+#else
#include "gvarargs.h"
+#endif
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
extern void dump_local_alloc ();
void rest_of_decl_compilation ();
-void error ();
-void error_with_file_and_line ();
+void error_with_file_and_line PROTO((char *file, int line, char *s, ...));
+void error_with_decl PROTO((tree decl, char *s, ...));
+void error_for_asm PROTO((rtx insn, char *s, ...));
+void error PROTO((char *s, ...));
+void fatal PROTO((char *s, ...));
+void warning_with_file_and_line PROTO((char *file, int line, char *s, ...));
+void warning_with_decl PROTO((tree decl, char *s, ...));
+void warning_for_asm PROTO((rtx insn, char *s, ...));
+void warning PROTO((char *s, ...));
+void pedwarn PROTO((char *s, ...));
+void pedwarn_with_decl PROTO((tree decl, char *s, ...));
+void pedwarn_with_file_and_line PROTO((char *file, int line, char *s, ...));
+void sorry PROTO((char *s, ...));
+void really_sorry PROTO((char *s, ...));
void fancy_abort ();
#ifndef abort
void abort ();
}
void
-error_with_file_and_line (va_alist)
- va_dcl
- /* (char *file, int line, char *s, ...) */
+error_with_file_and_line VPROTO((char *file, int line, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *file;
int line;
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
+#endif
+
v_error_with_file_and_line (file, line, s, ap);
va_end (ap);
}
}
void
-error_with_decl (va_alist)
- va_dcl
- /* (tree decl, char *s, ...) */
+error_with_decl VPROTO((tree decl, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
tree decl;
char *s;
+#endif
+ va_list ap;
- va_start (ap);
+ VA_START (ap, s);
+
+#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
+#endif
+
v_error_with_decl (decl, s, ap);
va_end (ap);
}
}
void
-error_for_asm (va_alist)
- va_dcl
- /* (rtx insn, char *s, ...) */
+error_for_asm VPROTO((rtx insn, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
rtx insn;
char *s;
+#endif
+ va_list ap;
- va_start (ap);
+ VA_START (ap, s);
+
+#ifndef __STDC__
insn = va_arg (ap, rtx);
s = va_arg (ap, char *);
+#endif
+
v_error_for_asm (insn, s, ap);
va_end (ap);
}
}
void
-error (va_alist)
- va_dcl
- /* (char *s, ...) */
+error VPROTO((char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
s = va_arg (ap, char *);
+#endif
+
verror (s, ap);
va_end (ap);
}
}
void
-fatal (va_alist)
- va_dcl
- /* (char *s, ...) */
+fatal VPROTO((char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
s = va_arg (ap, char *);
+#endif
+
vfatal (s, ap);
va_end (ap);
}
}
void
-warning_with_file_and_line (va_alist)
- va_dcl
- /* (char *file, int line, char *s, ...) */
+warning_with_file_and_line VPROTO((char *file, int line, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *file;
int line;
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
+#endif
+
v_warning_with_file_and_line (file, line, s, ap);
va_end (ap);
}
}
void
-warning_with_decl (va_alist)
- va_dcl
- /* (tree decl, char *s, ...) */
+warning_with_decl VPROTO((tree decl, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
tree decl;
char *s;
+#endif
+ va_list ap;
- va_start (ap);
+ VA_START (ap, s);
+
+#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
+#endif
+
v_warning_with_decl (decl, s, ap);
va_end (ap);
}
}
void
-warning_for_asm (va_alist)
- va_dcl
- /* (rtx insn, char *s, ...) */
+warning_for_asm VPROTO((rtx insn, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
rtx insn;
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
insn = va_arg (ap, rtx);
s = va_arg (ap, char *);
+#endif
+
v_warning_for_asm (insn, s, ap);
va_end (ap);
}
}
void
-warning (va_alist)
- va_dcl
+warning VPROTO((char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
s = va_arg (ap, char *);
+#endif
+
vwarning (s, ap);
va_end (ap);
}
}
void
-pedwarn (va_alist)
- va_dcl
- /* (char *s, ...) */
+pedwarn VPROTO((char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
s = va_arg (ap, char *);
+#endif
+
vpedwarn (s, ap);
va_end (ap);
}
}
void
-pedwarn_with_decl (va_alist)
- va_dcl
- /* (tree decl, char *s, ...) */
+pedwarn_with_decl VPROTO((tree decl, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
tree decl;
char *s;
+#endif
+ va_list ap;
- va_start (ap);
+ VA_START (ap, s);
+
+#ifndef __STDC__
decl = va_arg (ap, tree);
s = va_arg (ap, char *);
+#endif
+
v_pedwarn_with_decl (decl, s, ap);
va_end (ap);
}
}
void
-pedwarn_with_file_and_line (va_alist)
- va_dcl
- /* (char *file, int line, char *s, ...) */
+pedwarn_with_file_and_line VPROTO((char *file, int line, char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *file;
int line;
char *s;
+#endif
+ va_list ap;
- va_start (ap);
+ VA_START (ap, s);
+
+#ifndef __STDC__
file = va_arg (ap, char *);
line = va_arg (ap, int);
s = va_arg (ap, char *);
+#endif
+
v_pedwarn_with_file_and_line (file, line, s, ap);
va_end (ap);
}
}
void
-sorry (va_alist)
- va_dcl
- /* (char *s, ...) */
+sorry VPROTO((char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
s = va_arg (ap, char *);
+#endif
+
vsorry (s, ap);
va_end (ap);
}
}
void
-really_sorry (va_alist)
- va_dcl
- /* (char *s, ...) */
+really_sorry VPROTO((char *s, ...))
{
- va_list ap;
+#ifndef __STDC__
char *s;
+#endif
+ va_list ap;
+
+ VA_START (ap, s);
- va_start (ap);
+#ifndef __STDC__
s = va_arg (ap, char *);
+#endif
+
v_really_sorry (s, ap);
va_end (ap);
}