This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Use VA_OPEN Makros
- To: gcc-patches at gcc dot gnu dot org
- Subject: Use VA_OPEN Makros
- From: Andreas Jaeger <aj at suse dot de>
- Date: Sun, 26 Aug 2001 19:57:02 +0200
As discussed with Mark and Zack, here's a patch to use VA_OPEN etc in GCC.
I didn't touch genattrtab (there's a function with lots of
va_end;return and I didn't want to add even more gotos there),
prefix.c (concat calls VA_START twice and I think this won't work with
VA_OPEN) and the java files (those will come separatly).
During this conversion I also fixed one or two places that never
worked with ANSI_PROTOTYPES, e.g. dw2_asm_output_nstring.
Bootstrapped/regtested on i686-linux-gnu.
Ok to commit?
Andreas
2001-08-26 Andreas Jaeger <aj@suse.de>
* emit-rtl.c: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
* errors.c: Likewise.
* final.c: Likewise.
* dwarf2asm.c: Likewise.
* doprint.c (checkit): Likewise.
* diagnostic.c: Likewise.
* collect2.c: Likewise.
* calls.c: Likewise.
* c-semantics.c (build_stmt): Likewise.
* c-format.c (status_warning): Likewise.
* c-errors.c (pedwarn_c99): Likewise.
* builtins.c (validate_arglist): Likewise.
* config/pj/pj.c (pj_printf): Likewise.
* fix-header.c: Likewise.
* gcc.c: Likewise.
* gcov.c (fnotice): Likewise.
* gensupport.c (message_with_line): Likewise.
* mips-tfile.c: Likewise.
* protoize.c (notice): Likewise.
* read-rtl.c (fatal_with_file_and_line): Likewise.
* rtl-error.c: Likewise.
* tradcpp.c: Likewise.
* tree.c: Likewise.
* cp/tree.c (build_min_nt): Likewise.
(build_min): Likewise.
* cp/lex.c: Likewise.
* cp/errfn.c: Likewise.
* cp/rtti.c (create_pseudo_type_info): Likewise.
============================================================
Index: gcc/emit-rtl.c
--- gcc/emit-rtl.c 2001/08/22 14:35:02 1.199
+++ gcc/emit-rtl.c 2001/08/26 08:59:23
@@ -424,22 +424,14 @@
rtx
gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...))
{
-#ifndef ANSI_PROTOTYPES
- enum rtx_code code;
- enum machine_mode mode;
-#endif
- va_list p;
register int i; /* Array indices... */
register const char *fmt; /* Current rtx's format... */
register rtx rt_val; /* RTX to return to caller... */
- VA_START (p, mode);
+ VA_OPEN (p, mode);
+ VA_FIXEDARG (p, enum rtx_code, code);
+ VA_FIXEDARG (p, enum machine_mode, mode);
-#ifndef ANSI_PROTOTYPES
- code = va_arg (p, enum rtx_code);
- mode = va_arg (p, enum machine_mode);
-#endif
-
switch (code)
{
case CONST_INT:
@@ -511,7 +503,7 @@
break;
}
- va_end (p);
+ VA_CLOSE (p);
return rt_val;
}
@@ -525,18 +517,11 @@
rtvec
gen_rtvec VPARAMS ((int n, ...))
{
-#ifndef ANSI_PROTOTYPES
- int n;
-#endif
int i;
- va_list p;
rtx *vector;
-
- VA_START (p, n);
-#ifndef ANSI_PROTOTYPES
- n = va_arg (p, int);
-#endif
+ VA_OPEN (p, n);
+ VA_FIXEDARG (p, int, n);
if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
@@ -545,7 +530,7 @@
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
- va_end (p);
+ VA_CLOSE (p);
return gen_rtvec_v (n, vector);
}
============================================================
Index: gcc/errors.c
--- gcc/errors.c 2001/08/22 14:35:02 1.7
+++ gcc/errors.c 2001/08/26 08:59:23
@@ -39,20 +39,12 @@
void
warning VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
fprintf (stderr, "%s: warning: ", progname);
vfprintf (stderr, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
fputc('\n', stderr);
}
@@ -62,20 +54,12 @@
void
error VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
fprintf (stderr, "%s: ", progname);
vfprintf (stderr, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
fputc('\n', stderr);
have_error = 1;
@@ -87,20 +71,12 @@
void
fatal VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
fprintf (stderr, "%s: ", progname);
vfprintf (stderr, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
fputc('\n', stderr);
exit (FATAL_EXIT_CODE);
}
@@ -110,20 +86,12 @@
void
internal_error VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
fprintf (stderr, "%s: Internal error: ", progname);
vfprintf (stderr, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
fputc ('\n', stderr);
exit (FATAL_EXIT_CODE);
}
============================================================
Index: gcc/final.c
--- gcc/final.c 2001/08/22 16:29:08 1.202
+++ gcc/final.c 2001/08/26 08:59:28
@@ -3651,20 +3651,12 @@
void
asm_fprintf VPARAMS ((FILE *file, const char *p, ...))
{
-#ifndef ANSI_PROTOTYPES
- FILE *file;
- const char *p;
-#endif
- va_list argptr;
char buf[10];
char *q, c;
-
- VA_START (argptr, p);
-#ifndef ANSI_PROTOTYPES
- file = va_arg (argptr, FILE *);
- p = va_arg (argptr, const char *);
-#endif
+ VA_OPEN (argptr, p);
+ VA_FIXEDARG (argptr, FILE *, file);
+ VA_FIXEDARG (argptr, const char *, p);
buf[0] = '%';
@@ -3812,7 +3804,7 @@
default:
fputc (c, file);
}
- va_end (argptr);
+ VA_CLOSE (argptr);
}
/* Split up a CONST_DOUBLE or integer constant rtx
============================================================
Index: gcc/dwarf2asm.c
--- gcc/dwarf2asm.c 2001/08/22 14:35:01 1.12
+++ gcc/dwarf2asm.c 2001/08/26 08:59:28
@@ -84,21 +84,11 @@
dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int size;
- unsigned HOST_WIDE_INT value;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, size);
+ VA_FIXEDARG (ap, unsigned HOST_WIDE_INT, value);
+ VA_FIXEDARG (ap, const char *, comment);
-#ifndef ANSI_PROTOTYPES
- size = va_arg (ap, int);
- value = va_arg (ap, unsigned HOST_WIDE_INT);
- comment = va_arg (ap, const char *);
-#endif
-
if (size * 8 < HOST_BITS_PER_WIDE_INT)
value &= ~(~(unsigned HOST_WIDE_INT)0 << (size * 8));
@@ -116,7 +106,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Output the difference between two symbols in a given size. */
@@ -129,21 +119,11 @@
dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int size;
- const char *lab1, *lab2;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- size = va_arg (ap, int);
- lab1 = va_arg (ap, const char *);
- lab2 = va_arg (ap, const char *);
- comment = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, size);
+ VA_FIXEDARG (ap, const char *, lab1);
+ VA_FIXEDARG (ap, const char *, lab2);
+ VA_FIXEDARG (ap, const char *, comment);
#ifdef UNALIGNED_INT_ASM_OP
fputs (unaligned_integer_asm_op (size), asm_out_file);
@@ -163,7 +143,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Output a section-relative reference to a label. In general this
@@ -176,21 +156,11 @@
dw2_asm_output_offset VPARAMS ((int size, const char *label,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int size;
- const char *label;
- const char *comment;
-#endif
- va_list ap;
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, size);
+ VA_FIXEDARG (ap, const char *, label);
+ VA_FIXEDARG (ap, const char *, comment);
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- size = va_arg (ap, int);
- label = va_arg (ap, const char *);
- comment = va_arg (ap, const char *);
-#endif
-
#ifdef ASM_OUTPUT_DWARF_OFFSET
ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label);
#else
@@ -209,7 +179,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Output a self-relative reference to a label, possibly in a
@@ -219,21 +189,11 @@
dw2_asm_output_pcrel VPARAMS ((int size, const char *label,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int size;
- const char *label;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, size);
+ VA_FIXEDARG (ap, const char *, label);
+ VA_FIXEDARG (ap, const char *, comment);
-#ifndef ANSI_PROTOTYPES
- size = va_arg (ap, int);
- label = va_arg (ap, const char *);
- comment = va_arg (ap, const char *);
-#endif
-
#ifdef ASM_OUTPUT_DWARF_PCREL
ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
#else
@@ -254,7 +214,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Output an absolute reference to a label. */
@@ -263,21 +223,11 @@
dw2_asm_output_addr VPARAMS ((int size, const char *label,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int size;
- const char *label;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, size);
+ VA_FIXEDARG (ap, const char *, label);
+ VA_FIXEDARG (ap, const char *, comment);
-#ifndef ANSI_PROTOTYPES
- size = va_arg (ap, int);
- label = va_arg (ap, const char *);
- comment = va_arg (ap, const char *);
-#endif
-
#ifdef UNALIGNED_INT_ASM_OP
fputs (unaligned_integer_asm_op (size), asm_out_file);
assemble_name (asm_out_file, label);
@@ -292,7 +242,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Similar, but use an RTX expression instead of a text label. */
@@ -301,20 +251,10 @@
dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int size;
- rtx addr;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- size = va_arg (ap, int);
- addr = va_arg (ap, rtx);
- comment = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, size);
+ VA_FIXEDARG (ap, rtx, addr);
+ VA_FIXEDARG (ap, const char *, comment);
#ifdef UNALIGNED_INT_ASM_OP
fputs (unaligned_integer_asm_op (size), asm_out_file);
@@ -330,29 +270,22 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
dw2_asm_output_nstring VPARAMS ((const char *str, size_t orig_len,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *str;
- size_t orig_len;
- const char *comment;
-#endif
- va_list ap;
- size_t i, len = orig_len;
-
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- str = va_arg (ap, const char *);
- len = va_arg (ap, size_t);
- comment = va_arg (ap, const char *);
-#endif
+ size_t i, len;
+
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, const char *, str);
+ VA_FIXEDARG (ap, size_t, len);
+ VA_FIXEDARG (ap, const char *, comment);
+ len = orig_len;
+
if (len == (size_t) -1)
len = strlen (str);
@@ -384,7 +317,7 @@
fprintf (asm_out_file, "%s0\n", ASM_BYTE_OP);
}
- va_end (ap);
+ VA_CLOSE (ap);
}
@@ -617,19 +550,10 @@
dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- unsigned HOST_WIDE_INT value;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, unsigned HOST_WIDE_INT, value);
+ VA_FIXEDARG (ap, const char *, comment);
-#ifndef ANSI_PROTOTYPES
- value = va_arg (ap, unsigned HOST_WIDE_INT);
- comment = va_arg (ap, const char *);
-#endif
-
#ifdef HAVE_AS_LEB128
fputs ("\t.uleb128 ", asm_out_file);
fprintf (asm_out_file, HOST_WIDE_INT_PRINT_HEX, value);
@@ -672,7 +596,7 @@
#endif
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Output an signed LEB128 quantity. */
@@ -681,18 +605,9 @@
dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- HOST_WIDE_INT value;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- value = va_arg (ap, HOST_WIDE_INT);
- comment = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, HOST_WIDE_INT, value);
+ VA_FIXEDARG (ap, const char *, comment);
#ifdef HAVE_AS_LEB128
fputs ("\t.sleb128 ", asm_out_file);
@@ -739,7 +654,7 @@
#endif
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
@@ -747,19 +662,10 @@
const char *lab2 ATTRIBUTE_UNUSED,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *lab1, *lab2;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- lab1 = va_arg (ap, const char *);
- lab2 = va_arg (ap, const char *);
- comment = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, const char *, lab1);
+ VA_FIXEDARG (ap, const char *, lab2);
+ VA_FIXEDARG (ap, const char *, comment);
#ifdef HAVE_AS_LEB128
fputs ("\t.uleb128 ", asm_out_file);
@@ -777,7 +683,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
@@ -785,19 +691,10 @@
const char *lab2 ATTRIBUTE_UNUSED,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *lab1, *lab2;
- const char *comment;
-#endif
- va_list ap;
-
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- lab1 = va_arg (ap, const char *);
- lab2 = va_arg (ap, const char *);
- comment = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, const char *, lab1);
+ VA_FIXEDARG (ap, const char *, lab2);
+ VA_FIXEDARG (ap, const char *, comment);
#ifdef HAVE_AS_LEB128
fputs ("\t.sleb128 ", asm_out_file);
@@ -815,7 +712,7 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
static rtx dw2_force_const_mem PARAMS ((rtx));
@@ -912,21 +809,12 @@
rtx addr,
const char *comment, ...))
{
-#ifndef ANSI_PROTOTYPES
- int encoding;
- rtx addr;
- const char *comment;
-#endif
- va_list ap;
int size;
- VA_START (ap, comment);
-
-#ifndef ANSI_PROTOTYPES
- encoding = va_arg (ap, int);
- addr = va_arg (ap, rtx);
- comment = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, comment);
+ VA_FIXEDARG (ap, int, encoding);
+ VA_FIXEDARG (ap, rtx, addr);
+ VA_FIXEDARG (ap, const char *, comment);
size = size_of_encoded_value (encoding);
@@ -1010,5 +898,5 @@
}
fputc ('\n', asm_out_file);
- va_end (ap);
+ VA_CLOSE (ap);
}
============================================================
Index: gcc/doprint.c
--- gcc/doprint.c 2001/08/08 22:06:46 1.10
+++ gcc/doprint.c 2001/08/26 08:59:28
@@ -1,5 +1,5 @@
/* Provide a version _doprnt in terms of fprintf.
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Kaveh Ghazi (ghazi@caip.rutgers.edu) 3/29/98
This program is free software; you can redistribute it and/or modify it
@@ -209,21 +209,12 @@
static int
checkit VPARAMS ((const char* format, ...))
{
- va_list args;
int result;
+ VA_OPEN (args, format);
+ VA_FIXEDARG (args, char *, format);
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
-
- VA_START (args, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (args, char *);
-#endif
-
result = _doprnt (format, args, stdout);
- va_end(args);
+ VA_CLOSE (args);
return result;
}
============================================================
Index: gcc/collect2.c
--- gcc/collect2.c 2001/08/22 14:34:47 1.115
+++ gcc/collect2.c 2001/08/26 08:59:32
@@ -363,19 +363,11 @@
void
notice VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
vfprintf (stderr, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Die when sys call fails. */
@@ -383,22 +375,15 @@
void
fatal_perror VPARAMS ((const char * msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
int e = errno;
- va_list ap;
- VA_START (ap, msgid);
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
-
fprintf (stderr, "collect2: ");
vfprintf (stderr, _(msgid), ap);
fprintf (stderr, ": %s\n", xstrerror (e));
- va_end (ap);
+ VA_CLOSE (ap);
collect_exit (FATAL_EXIT_CODE);
}
@@ -408,21 +393,13 @@
void
fatal VPARAMS ((const char * msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
fprintf (stderr, "collect2: ");
vfprintf (stderr, _(msgid), ap);
fprintf (stderr, "\n");
- va_end (ap);
+ VA_CLOSE (ap);
collect_exit (FATAL_EXIT_CODE);
}
@@ -432,21 +409,13 @@
void
error VPARAMS ((const char * msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char * msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
fprintf (stderr, "collect2: ");
vfprintf (stderr, _(msgid), ap);
fprintf (stderr, "\n");
- va_end(ap);
+ VA_CLOSE(ap);
}
/* In case obstack is linked in, and abort is defined to fancy_abort,
============================================================
Index: gcc/c-semantics.c
--- gcc/c-semantics.c 2001/08/22 14:34:46 1.32
+++ gcc/c-semantics.c 2001/08/26 08:59:33
@@ -170,20 +170,13 @@
tree
build_stmt VPARAMS ((enum tree_code code, ...))
{
-#ifndef ANSI_PROTOTYPES
- enum tree_code code;
-#endif
- va_list p;
register tree t;
register int length;
register int i;
- VA_START (p, code);
+ VA_OPEN (p, code);
+ VA_FIXEDARG (p, enum tree_code, code);
-#ifndef ANSI_PROTOTYPES
- code = va_arg (p, enum tree_code);
-#endif
-
t = make_node (code);
length = TREE_CODE_LENGTH (code);
STMT_LINENO (t) = lineno;
@@ -191,7 +184,7 @@
for (i = 0; i < length; i++)
TREE_OPERAND (t, i) = va_arg (p, tree);
- va_end (p);
+ VA_CLOSE (p);
return t;
}
============================================================
Index: gcc/c-format.c
--- gcc/c-format.c 2001/08/22 14:34:44 1.4
+++ gcc/c-format.c 2001/08/26 08:59:35
@@ -1149,20 +1149,12 @@
static void
status_warning VPARAMS ((int *status, const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- int *status;
- const char *msgid;
-#endif
- va_list ap;
diagnostic_context dc;
- VA_START (ap, msgid);
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, int *, status);
+ VA_FIXEDARG (ap, const char *, msgid);
-#ifndef ANSI_PROTOTYPES
- status = va_arg (ap, int *);
- msgid = va_arg (ap, const char *);
-#endif
-
if (status)
*status = 1;
else
@@ -1173,7 +1165,7 @@
report_diagnostic (&dc);
}
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Variables used by the checking of $ operand number formats. */
============================================================
Index: gcc/c-errors.c
--- gcc/c-errors.c 2001/08/22 14:34:44 1.4
+++ gcc/c-errors.c 2001/08/26 08:59:35
@@ -1,5 +1,5 @@
/* Various diagnostic subroutines for the GNU C language.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
This file is part of GCC.
@@ -32,20 +32,13 @@
void
pedwarn_c99 VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
diagnostic_context dc;
- VA_START (ap, msgid);
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
-
set_diagnostic_context (&dc, msgid, &ap, input_filename, lineno,
!flag_isoc99 || !flag_pedantic_errors);
report_diagnostic (&dc);
- va_end (ap);
+ VA_CLOSE (ap);
}
============================================================
Index: gcc/builtins.c
--- gcc/builtins.c 2001/08/22 14:34:42 1.115
+++ gcc/builtins.c 2001/08/26 08:59:39
@@ -3864,44 +3864,42 @@
static int
validate_arglist VPARAMS ((tree arglist, ...))
{
-#ifndef ANSI_PROTOTYPES
- tree arglist;
-#endif
enum tree_code code;
- va_list ap;
+ int res = 0;
- VA_START (ap, arglist);
+ VA_OPEN (ap, arglist);
+ VA_FIXEDARG (ap, tree, arglist);
-#ifndef ANSI_PROTOTYPES
- arglist = va_arg (ap, tree);
-#endif
-
do {
code = va_arg (ap, enum tree_code);
switch (code)
{
case 0:
/* This signifies an ellipses, any further arguments are all ok. */
- va_end (ap);
- return 1;
+ res = 1;
+ goto end;
case VOID_TYPE:
/* This signifies an endlink, if no arguments remain, return
true, otherwise return false. */
- va_end (ap);
- return arglist == 0;
+ res = arglist == 0;
+ goto end;
default:
/* If no parameters remain or the parameter's code does not
match the specified code, return false. Otherwise continue
checking any remaining arguments. */
if (arglist == 0 || code != TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))))
- {
- va_end (ap);
- return 0;
- }
+ goto end;
break;
}
arglist = TREE_CHAIN (arglist);
} while (1);
+
+ /* We need gotos here since we can only have one VA_CLOSE in a
+ function. */
+ end: ;
+ VA_CLOSE (ap);
+
+ return res;
}
/* Default version of target-specific builtin setup that does nothing. */
============================================================
Index: gcc/fix-header.c
--- gcc/fix-header.c 2001/08/22 20:37:20 1.71
+++ gcc/fix-header.c 2001/08/26 08:59:40
@@ -1,6 +1,6 @@
/* fix-header.c - Make C header file suitable for C++.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -1317,17 +1317,9 @@
static void
fatal VPARAMS ((const char *str, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *str;
-#endif
- va_list ap;
-
- VA_START (ap, str);
-
-#ifndef ANSI_PROTOTYPES
- str = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, str);
+ VA_FIXEDARG (ap, const char *, str);
v_fatal (str, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
============================================================
Index: gcc/gcc.c
--- gcc/gcc.c 2001/08/22 18:09:23 1.245
+++ gcc/gcc.c 2001/08/26 08:59:47
@@ -6204,20 +6204,12 @@
void
fatal VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
fprintf (stderr, "%s: ", programname);
vfprintf (stderr, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
fprintf (stderr, "\n");
delete_temp_files ();
exit (1);
@@ -6226,20 +6218,12 @@
void
error VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
fprintf (stderr, "%s: ", programname);
vfprintf (stderr, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
fprintf (stderr, "\n");
}
@@ -6247,19 +6231,11 @@
static void
notice VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
vfprintf (stderr, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
static void
============================================================
Index: gcc/gcov.c
--- gcc/gcov.c 2001/08/12 23:40:50 1.34
+++ gcc/gcov.c 2001/08/26 08:59:49
@@ -273,21 +273,12 @@
static void
fnotice VPARAMS ((FILE *file, const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- FILE *file;
- const char *msgid;
-#endif
- va_list ap;
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, FILE *, file);
+ VA_FIXEDARG (ap, const char *, msgid);
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- file = va_arg (ap, FILE *);
- msgid = va_arg (ap, const char *);
-#endif
-
vfprintf (file, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* More 'friendly' abort that prints the line and file.
============================================================
Index: gcc/gensupport.c
--- gcc/gensupport.c 2001/08/22 14:35:17 1.18
+++ gcc/gensupport.c 2001/08/26 08:59:49
@@ -79,24 +79,15 @@
void
message_with_line VPARAMS ((int lineno, const char *msg, ...))
{
-#ifndef ANSI_PROTOTYPES
- int lineno;
- const char *msg;
-#endif
- va_list ap;
+ VA_OPEN (ap, msg);
+ VA_FIXEDARG (ap, int, lineno);
+ VA_FIXEDARG (ap, const char *, msg);
- VA_START (ap, msg);
-
-#ifndef ANSI_PROTOTYPES
- lineno = va_arg (ap, int);
- msg = va_arg (ap, const char *);
-#endif
-
fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno);
vfprintf (stderr, msg, ap);
fputc ('\n', stderr);
- va_end (ap);
+ VA_CLOSE (ap);
}
/* Queue PATTERN on LIST_TAIL. */
============================================================
Index: gcc/mips-tfile.c
--- gcc/mips-tfile.c 2001/08/22 14:35:30 1.40
+++ gcc/mips-tfile.c 2001/08/26 08:59:54
@@ -5561,16 +5561,8 @@
void
fatal VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (line_number > 0)
fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
@@ -5578,7 +5570,7 @@
fprintf (stderr, "%s:", progname);
vfprintf (stderr, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
fprintf (stderr, "\n");
if (line_number > 0)
fprintf (stderr, "line:\t%s\n", cur_line_start);
@@ -5591,16 +5583,8 @@
void
error VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, char *, format);
if (line_number > 0)
fprintf (stderr, "%s, %s:%ld ", progname, input_name, line_number);
@@ -5613,7 +5597,7 @@
fprintf (stderr, "line:\t%s\n", cur_line_start);
had_errors++;
- va_end (ap);
+ VA_CLOSE (ap);
saber_stop ();
}
============================================================
Index: gcc/protoize.c
--- gcc/protoize.c 2001/08/22 14:35:32 1.60
+++ gcc/protoize.c 2001/08/26 09:00:01
@@ -1,6 +1,6 @@
/* Protoize program - Original version by Ron Guilmette (rfg@segfault.us.com).
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GCC.
@@ -564,19 +564,11 @@
static void
notice VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
vfprintf (stderr, _(msgid), ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
============================================================
Index: gcc/read-rtl.c
--- gcc/read-rtl.c 2001/08/22 14:35:32 1.4
+++ gcc/read-rtl.c 2001/08/26 09:00:01
@@ -53,22 +53,14 @@
static void
fatal_with_file_and_line VPARAMS ((FILE *infile, const char *msg, ...))
{
-#ifndef ANSI_PROTOTYPES
- FILE *infile;
- const char *msg;
-#endif
- va_list ap;
char context[64];
size_t i;
int c;
- VA_START (ap, msg);
+ VA_OPEN (ap, msg);
+ VA_FIXEDARG (ap, FILE *, infile);
+ VA_FIXEDARG (ap, const char *, msg);
-#ifndef ANSI_PROTOTYPES
- infile = va_arg (ap, FILE *);
- msg = va_arg (ap, const char *);
-#endif
-
fprintf (stderr, "%s:%d: ", read_rtx_filename, read_rtx_lineno);
vfprintf (stderr, msg, ap);
putc ('\n', stderr);
@@ -88,7 +80,7 @@
fprintf (stderr, "%s:%d: following context is `%s'\n",
read_rtx_filename, read_rtx_lineno, context);
- va_end (ap);
+ VA_CLOSE (ap);
exit (1);
}
============================================================
Index: gcc/rtl-error.c
--- gcc/rtl-error.c 2001/08/23 10:21:42 1.2
+++ gcc/rtl-error.c 2001/08/26 09:00:01
@@ -91,41 +91,23 @@
void
error_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- rtx insn;
- const char *msgid;
-#endif
- va_list ap;
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, rtx, insn);
+ VA_FIXEDARG (ap, const char *, msgid);
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- insn = va_arg (ap, rtx);
- msgid = va_arg (ap, const char *);
-#endif
-
diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 0);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- rtx insn;
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START (ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- insn = va_arg (ap, rtx);
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN (ap, msgid);
+ VA_FIXEDARG (ap, rtx, insn);
+ VA_FIXEDARG (ap, const char *, msgid);
diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 1);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
============================================================
Index: gcc/tradcpp.c
--- gcc/tradcpp.c 2001/08/21 17:10:21 1.36
+++ gcc/tradcpp.c 2001/08/26 09:00:06
@@ -4686,37 +4686,22 @@
void
error VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START(ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN(ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
v_message (ERROR, 0, msgid, ap);
+ VA_CLOSE (ap);
}
void
error_with_line VPARAMS ((int line, const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- int line;
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START(ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- line = va_arg (ap, int);
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN(ap, msgid);
+ VA_FIXEDARG (ap, int, line);
+ VA_FIXEDARG (ap, const char *, msgid);
v_message (ERROR, line, msgid, ap);
+ VA_CLOSE (ap);
}
/* Error including a message from `errno'. */
@@ -4731,35 +4716,21 @@
void
warning VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START(ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN(ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
v_message (WARNING, 0, msgid, ap);
+ VA_CLOSE (ap);
}
void
fatal VPARAMS ((const char *msgid, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msgid;
-#endif
- va_list ap;
-
- VA_START(ap, msgid);
-
-#ifndef ANSI_PROTOTYPES
- msgid = va_arg (ap, const char *);
-#endif
+ VA_OPEN(ap, msgid);
+ VA_FIXEDARG (ap, const char *, msgid);
v_message (FATAL, 0, msgid, ap);
+ VA_CLOSE (ap);
exit (FATAL_EXIT_CODE);
}
============================================================
Index: gcc/tree.c
--- gcc/tree.c 2001/08/22 14:35:49 1.205
+++ gcc/tree.c 2001/08/26 09:00:11
@@ -2334,23 +2334,15 @@
tree
build VPARAMS ((enum tree_code code, tree tt, ...))
{
-#ifndef ANSI_PROTOTYPES
- enum tree_code code;
- tree tt;
-#endif
- va_list p;
register tree t;
register int length;
register int i;
int fro;
int constant;
-
- VA_START (p, tt);
-#ifndef ANSI_PROTOTYPES
- code = va_arg (p, enum tree_code);
- tt = va_arg (p, tree);
-#endif
+ VA_OPEN (p, tt);
+ VA_FIXEDARG (p, enum tree_code, code);
+ VA_FIXEDARG (p, tree, tt);
t = make_node (code);
length = TREE_CODE_LENGTH (code);
@@ -2427,7 +2419,7 @@
}
}
}
- va_end (p);
+ VA_CLOSE (p);
TREE_CONSTANT (t) = constant;
return t;
@@ -2518,19 +2510,12 @@
tree
build_nt VPARAMS ((enum tree_code code, ...))
{
-#ifndef ANSI_PROTOTYPES
- enum tree_code code;
-#endif
- va_list p;
register tree t;
register int length;
register int i;
-
- VA_START (p, code);
-#ifndef ANSI_PROTOTYPES
- code = va_arg (p, enum tree_code);
-#endif
+ VA_OPEN (p, code);
+ VA_FIXEDARG (p, enum tree_code, code);
t = make_node (code);
length = TREE_CODE_LENGTH (code);
@@ -2538,7 +2523,7 @@
for (i = 0; i < length; i++)
TREE_OPERAND (t, i) = va_arg (p, tree);
- va_end (p);
+ VA_CLOSE (p);
return t;
}
============================================================
Index: gcc/config/pj/pj.c
--- gcc/config/pj/pj.c 2001/08/13 15:52:33 1.8
+++ gcc/config/pj/pj.c 2001/08/26 09:00:12
@@ -1,5 +1,5 @@
/* Output routines for GCC for picoJava II
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -140,18 +140,12 @@
static void
pj_printf VPARAMS ((const char *template, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *template;
-#endif
register int c;
-
- va_list argptr;
int ops_read = 0;
rtx operands[10];
- VA_START (argptr, template);
-#ifndef ANSI_PROTOTYPES
- template = va_arg (argptr, const char *);
-#endif
+
+ VA_OPEN (argptr, template);
+ VA_FIXEDARG (argptr, const char *, template);
while ((c = *template++))
{
@@ -229,7 +223,7 @@
}
}
}
- va_end (argptr);
+ VA_CLOSE (argptr);
}
/* Output code to efficiently push a single word integer constant onto
============================================================
Index: gcc/cp/tree.c
--- gcc/cp/tree.c 2001/08/24 12:07:46 1.251
+++ gcc/cp/tree.c 2001/08/26 09:00:15
@@ -1724,20 +1724,13 @@
tree
build_min_nt VPARAMS ((enum tree_code code, ...))
{
-#ifndef ANSI_PROTOTYPES
- enum tree_code code;
-#endif
- va_list p;
register tree t;
register int length;
register int i;
- VA_START (p, code);
+ VA_OPEN (p, code);
+ VA_FIXEDARG (p, enum tree_code, code);
-#ifndef ANSI_PROTOTYPES
- code = va_arg (p, enum tree_code);
-#endif
-
t = make_node (code);
length = TREE_CODE_LENGTH (code);
TREE_COMPLEXITY (t) = lineno;
@@ -1748,7 +1741,7 @@
TREE_OPERAND (t, i) = x;
}
- va_end (p);
+ VA_CLOSE (p);
return t;
}
@@ -1758,21 +1751,13 @@
tree
build_min VPARAMS ((enum tree_code code, tree tt, ...))
{
-#ifndef ANSI_PROTOTYPES
- enum tree_code code;
- tree tt;
-#endif
- va_list p;
register tree t;
register int length;
register int i;
-
- VA_START (p, tt);
-#ifndef ANSI_PROTOTYPES
- code = va_arg (p, enum tree_code);
- tt = va_arg (p, tree);
-#endif
+ VA_OPEN (p, tt);
+ VA_FIXEDARG (p, enum tree_code, code);
+ VA_FIXEDARG (p, tree, tt);
t = make_node (code);
length = TREE_CODE_LENGTH (code);
@@ -1785,7 +1770,7 @@
TREE_OPERAND (t, i) = x;
}
- va_end (p);
+ VA_CLOSE (p);
return t;
}
============================================================
Index: gcc/cp/lex.c
--- gcc/cp/lex.c 2001/06/26 19:18:37 1.246
+++ gcc/cp/lex.c 2001/08/26 09:00:16
@@ -1636,20 +1636,14 @@
void
compiler_error VPARAMS ((const char *msg, ...))
{
-#ifndef ANSI_PROTOTYPES
- const char *msg;
-#endif
char buf[1024];
- va_list ap;
- VA_START (ap, msg);
+ VA_OPEN (ap, msg);
+ VA_FIXEDARG (ap, const char *, msg);
-#ifndef ANSI_PROTOTYPES
- msg = va_arg (ap, const char *);
-#endif
-
vsprintf (buf, msg, ap);
- va_end (ap);
+ VA_CLOSE (ap);
+
error_with_file_and_line (input_filename, lineno, "%s (compiler error)", buf);
}
============================================================
Index: gcc/cp/errfn.c
--- gcc/cp/errfn.c 2001/02/12 14:29:08 1.30
+++ gcc/cp/errfn.c 2001/08/26 09:00:17
@@ -1,5 +1,5 @@
/* Provide a call-back mechanism for handling error output.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com)
@@ -185,77 +185,45 @@
void
cp_error VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) error, 0, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
cp_warning VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) warning, 0, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
cp_pedwarn VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) pedwarn, 0, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
cp_compiler_error VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) compiler_error, 0, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
@@ -271,74 +239,42 @@
void
cp_sprintf VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
cp_thing ((errorfn *) sprintf, 0, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
cp_error_at VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) error_with_file_and_line, 1, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
cp_warning_at VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) warning_with_file_and_line, 1, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
void
cp_pedwarn_at VPARAMS ((const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- char *format;
-#endif
- va_list ap;
-
- VA_START (ap, format);
-
-#ifndef ANSI_PROTOTYPES
- format = va_arg (ap, char *);
-#endif
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, const char *, format);
if (! cp_silent)
cp_thing ((errorfn *) pedwarn_with_file_and_line, 1, format, ap);
- va_end (ap);
+ VA_CLOSE (ap);
}
============================================================
Index: gcc/cp/rtti.c
--- gcc/cp/rtti.c 2001/08/24 17:00:33 1.122
+++ gcc/cp/rtti.c 2001/08/26 09:00:18
@@ -1154,11 +1154,6 @@
static tree
create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...))
{
-#ifndef ANSI_PROTOTYPES
- char const *real_name;
- int ident;
-#endif
- va_list ap;
tree real_type, pseudo_type;
char *pseudo_name;
tree vtable_decl;
@@ -1166,12 +1161,10 @@
tree fields[10];
tree field_decl;
tree result;
-
- VA_START (ap, ident);
-#ifndef ANSI_PROTOTYPES
- real_name = va_arg (ap, char const *);
- ident = va_arg (ap, int);
-#endif
+
+ VA_OPEN (ap, ident);
+ VA_FIXEDARG (ap, const char *, real_name);
+ VA_FIXEDARG (ap, int, ident);
/* Generate the pseudo type name. */
pseudo_name = (char *)alloca (strlen (real_name) + 30);
@@ -1205,8 +1198,8 @@
pseudo_type = make_aggr_type (RECORD_TYPE);
finish_builtin_type (pseudo_type, pseudo_name, fields, ix, ptr_type_node);
TYPE_HAS_CONSTRUCTOR (pseudo_type) = 1;
- va_end (ap);
-
+ VA_CLOSE (ap);
+
result = tree_cons (NULL_TREE, NULL_TREE, NULL_TREE);
TINFO_VTABLE_DECL (result) = vtable_decl;
TINFO_PSEUDO_TYPE (result) = pseudo_type;
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj