diff options
author | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-27 06:48:43 +0000 |
---|---|---|
committer | aj <aj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-27 06:48:43 +0000 |
commit | 0903457a8fbc337677e7fa52c4f44934263f4447 (patch) | |
tree | 58234e1acd4f13f4f073a6ad3b59cad11faacb33 | |
parent | 512c9137754387fc3bcd18ac7f4bf63cda0c006a (diff) | |
download | gcc-0903457a8fbc337677e7fa52c4f44934263f4447.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45185 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 31 | ||||
-rw-r--r-- | gcc/builtins.c | 32 | ||||
-rw-r--r-- | gcc/c-errors.c | 15 | ||||
-rw-r--r-- | gcc/c-format.c | 16 | ||||
-rw-r--r-- | gcc/c-semantics.c | 13 | ||||
-rw-r--r-- | gcc/collect2.c | 55 | ||||
-rw-r--r-- | gcc/config/pj/pj.c | 16 | ||||
-rw-r--r-- | gcc/cp/errfn.c | 114 | ||||
-rw-r--r-- | gcc/cp/lex.c | 14 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 19 | ||||
-rw-r--r-- | gcc/cp/tree.c | 29 | ||||
-rw-r--r-- | gcc/doprint.c | 17 | ||||
-rw-r--r-- | gcc/dwarf2asm.c | 234 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 29 | ||||
-rw-r--r-- | gcc/errors.c | 56 | ||||
-rw-r--r-- | gcc/final.c | 16 | ||||
-rw-r--r-- | gcc/fix-header.c | 16 | ||||
-rw-r--r-- | gcc/gcc.c | 42 | ||||
-rw-r--r-- | gcc/gcov.c | 17 | ||||
-rw-r--r-- | gcc/gensupport.c | 17 | ||||
-rw-r--r-- | gcc/mips-tfile.c | 28 | ||||
-rw-r--r-- | gcc/protoize.c | 16 | ||||
-rw-r--r-- | gcc/read-rtl.c | 16 | ||||
-rw-r--r-- | gcc/rtl-error.c | 34 | ||||
-rw-r--r-- | gcc/tradcpp.c | 55 | ||||
-rw-r--r-- | gcc/tree.c | 29 |
26 files changed, 267 insertions, 709 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac3ca07beaa..ebcf81d78d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,34 @@ +2001-08-27 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. + Sun Aug 26 20:25:44 2001 Denis Chertykov <denisc@overta.ru> * df.c (df_uses_record): Return after recording all uses diff --git a/gcc/builtins.c b/gcc/builtins.c index 3b12b38cd23..53f6fa006b6 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3864,17 +3864,11 @@ build_function_call_expr (fn, arglist) static int validate_arglist VPARAMS ((tree arglist, ...)) { -#ifndef ANSI_PROTOTYPES - tree arglist; -#endif enum tree_code code; - va_list ap; - - VA_START (ap, arglist); + int res = 0; -#ifndef ANSI_PROTOTYPES - arglist = va_arg (ap, tree); -#endif + VA_OPEN (ap, arglist); + VA_FIXEDARG (ap, tree, arglist); do { code = va_arg (ap, enum tree_code); @@ -3882,26 +3876,30 @@ validate_arglist VPARAMS ((tree arglist, ...)) { 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. */ diff --git a/gcc/c-errors.c b/gcc/c-errors.c index 30a93d4fe4d..3f030f9a255 100644 --- a/gcc/c-errors.c +++ b/gcc/c-errors.c @@ -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 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA void pedwarn_c99 VPARAMS ((const char *msgid, ...)) { -#ifndef ANSI_PROTOTYPES - const char *msgid; -#endif - va_list ap; diagnostic_context dc; - VA_START (ap, msgid); - -#ifndef ANSI_PROTOTYPES - msgid = va_arg (ap, const char *); -#endif + VA_OPEN (ap, msgid); + VA_FIXEDARG (ap, const char *, msgid); set_diagnostic_context (&dc, msgid, &ap, input_filename, lineno, !flag_isoc99 || !flag_pedantic_errors); report_diagnostic (&dc); - va_end (ap); + VA_CLOSE (ap); } diff --git a/gcc/c-format.c b/gcc/c-format.c index 5ca4aceec46..d7ef210e4d4 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -1149,19 +1149,11 @@ check_function_format (status, name, assembler_name, params) 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); - -#ifndef ANSI_PROTOTYPES - status = va_arg (ap, int *); - msgid = va_arg (ap, const char *); -#endif + VA_OPEN (ap, msgid); + VA_FIXEDARG (ap, int *, status); + VA_FIXEDARG (ap, const char *, msgid); if (status) *status = 1; @@ -1173,7 +1165,7 @@ status_warning VPARAMS ((int *status, const char *msgid, ...)) report_diagnostic (&dc); } - va_end (ap); + VA_CLOSE (ap); } /* Variables used by the checking of $ operand number formats. */ diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 6da71b3e310..84000b9f853 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -170,19 +170,12 @@ finish_stmt_tree (t) 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); - -#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); @@ -191,7 +184,7 @@ build_stmt VPARAMS ((enum tree_code code, ...)) for (i = 0; i < length; i++) TREE_OPERAND (t, i) = va_arg (p, tree); - va_end (p); + VA_CLOSE (p); return t; } diff --git a/gcc/collect2.c b/gcc/collect2.c index d36b3e0bbff..3405f6ed107 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -363,19 +363,11 @@ collect_exit (status) 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 @@ notice VPARAMS ((const char *msgid, ...)) void fatal_perror VPARAMS ((const char * msgid, ...)) { -#ifndef ANSI_PROTOTYPES - const char *msgid; -#endif int e = errno; - 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, ": %s\n", xstrerror (e)); - va_end (ap); + VA_CLOSE (ap); collect_exit (FATAL_EXIT_CODE); } @@ -408,21 +393,13 @@ fatal_perror VPARAMS ((const char * msgid, ...)) 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 @@ fatal VPARAMS ((const char * msgid, ...)) 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, diff --git a/gcc/config/pj/pj.c b/gcc/config/pj/pj.c index 870960b0f9b..18525ce690d 100644 --- a/gcc/config/pj/pj.c +++ b/gcc/config/pj/pj.c @@ -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 @@ struct gcc_target targetm = TARGET_INITIALIZER; 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 @@ pj_printf VPARAMS ((const char *template, ...)) } } } - va_end (argptr); + VA_CLOSE (argptr); } /* Output code to efficiently push a single word integer constant onto diff --git a/gcc/cp/errfn.c b/gcc/cp/errfn.c index 351dba95888..84ad1f5e20f 100644 --- a/gcc/cp/errfn.c +++ b/gcc/cp/errfn.c @@ -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 @@ cp_thing (errfn, atarg1, format, ap) 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 @@ cp_deprecated (msg) 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); } diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 8cee04eb955..a05dd37b50c 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -1636,20 +1636,14 @@ make_aggr_type (code) void compiler_error VPARAMS ((const char *msg, ...)) { -#ifndef ANSI_PROTOTYPES - const char *msg; -#endif char buf[1024]; - va_list ap; - - VA_START (ap, msg); -#ifndef ANSI_PROTOTYPES - msg = va_arg (ap, const char *); -#endif + VA_OPEN (ap, msg); + VA_FIXEDARG (ap, const char *, msg); vsprintf (buf, msg, ap); - va_end (ap); + VA_CLOSE (ap); + error_with_file_and_line (input_filename, lineno, "%s (compiler error)", buf); } diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 89fa5a3db7d..6cdac79ac6a 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -1154,11 +1154,6 @@ create_real_tinfo_var (target_type, name, type, init, non_public) 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 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...)) 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 @@ create_pseudo_type_info VPARAMS((const char *real_name, int ident, ...)) 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; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index f5c651051d9..04e8add6a0d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1724,19 +1724,12 @@ break_out_target_exprs (t) 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); - -#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); @@ -1748,7 +1741,7 @@ build_min_nt VPARAMS ((enum tree_code code, ...)) TREE_OPERAND (t, i) = x; } - va_end (p); + VA_CLOSE (p); return t; } @@ -1758,21 +1751,13 @@ build_min_nt VPARAMS ((enum tree_code code, ...)) 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 @@ build_min VPARAMS ((enum tree_code code, tree tt, ...)) TREE_OPERAND (t, i) = x; } - va_end (p); + VA_CLOSE (p); return t; } diff --git a/gcc/doprint.c b/gcc/doprint.c index 114dcb7f77e..bc43b0322f0 100644 --- a/gcc/doprint.c +++ b/gcc/doprint.c @@ -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 PARAMS ((const char * format, ...)) ATTRIBUTE_PRINTF_1; static int checkit VPARAMS ((const char* format, ...)) { - va_list args; int result; - -#ifndef ANSI_PROTOTYPES - char *format; -#endif - - VA_START (args, format); - -#ifndef ANSI_PROTOTYPES - format = va_arg (args, char *); -#endif + VA_OPEN (args, format); + VA_FIXEDARG (args, char *, format); result = _doprnt (format, args, stdout); - va_end(args); + VA_CLOSE (args); return result; } diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index affa965ca2e..f9158cfa5c8 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -84,20 +84,10 @@ void 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); - -#ifndef ANSI_PROTOTYPES - size = va_arg (ap, int); - value = va_arg (ap, unsigned HOST_WIDE_INT); - comment = va_arg (ap, const char *); -#endif + VA_OPEN (ap, comment); + VA_FIXEDARG (ap, int, size); + VA_FIXEDARG (ap, unsigned HOST_WIDE_INT, value); + VA_FIXEDARG (ap, const char *, comment); if (size * 8 < HOST_BITS_PER_WIDE_INT) value &= ~(~(unsigned HOST_WIDE_INT)0 << (size * 8)); @@ -116,7 +106,7 @@ dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value, } 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 @@ void 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 @@ dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2, } fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } /* Output a section-relative reference to a label. In general this @@ -176,20 +156,10 @@ void 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_START (ap, comment); - -#ifndef ANSI_PROTOTYPES - size = va_arg (ap, int); - label = 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 *, label); + VA_FIXEDARG (ap, const char *, comment); #ifdef ASM_OUTPUT_DWARF_OFFSET ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label); @@ -209,7 +179,7 @@ dw2_asm_output_offset VPARAMS ((int size, const char *label, } fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } /* Output a self-relative reference to a label, possibly in a @@ -219,20 +189,10 @@ void 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); - -#ifndef ANSI_PROTOTYPES - size = va_arg (ap, int); - label = 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 *, label); + VA_FIXEDARG (ap, const char *, comment); #ifdef ASM_OUTPUT_DWARF_PCREL ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label); @@ -254,7 +214,7 @@ dw2_asm_output_pcrel VPARAMS ((int size, const char *label, } fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } /* Output an absolute reference to a label. */ @@ -263,20 +223,10 @@ void 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); - -#ifndef ANSI_PROTOTYPES - size = va_arg (ap, int); - label = 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 *, label); + VA_FIXEDARG (ap, const char *, comment); #ifdef UNALIGNED_INT_ASM_OP fputs (unaligned_integer_asm_op (size), asm_out_file); @@ -292,7 +242,7 @@ dw2_asm_output_addr VPARAMS ((int size, const char *label, } 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 @@ void 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,28 +270,21 @@ dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr, } 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; + size_t i, len; - VA_START (ap, comment); + VA_OPEN (ap, comment); + VA_FIXEDARG (ap, const char *, str); + VA_FIXEDARG (ap, size_t, len); + VA_FIXEDARG (ap, const char *, comment); -#ifndef ANSI_PROTOTYPES - str = va_arg (ap, const char *); - len = va_arg (ap, size_t); - comment = va_arg (ap, const char *); -#endif + len = orig_len; if (len == (size_t) -1) len = strlen (str); @@ -384,7 +317,7 @@ dw2_asm_output_nstring VPARAMS ((const char *str, size_t orig_len, fprintf (asm_out_file, "%s0\n", ASM_BYTE_OP); } - va_end (ap); + VA_CLOSE (ap); } @@ -617,18 +550,9 @@ void 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); - -#ifndef ANSI_PROTOTYPES - value = va_arg (ap, unsigned HOST_WIDE_INT); - comment = va_arg (ap, const char *); -#endif + VA_OPEN (ap, comment); + VA_FIXEDARG (ap, unsigned HOST_WIDE_INT, value); + VA_FIXEDARG (ap, const char *, comment); #ifdef HAVE_AS_LEB128 fputs ("\t.uleb128 ", asm_out_file); @@ -672,7 +596,7 @@ dw2_asm_output_data_uleb128 VPARAMS ((unsigned HOST_WIDE_INT value, #endif fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } /* Output an signed LEB128 quantity. */ @@ -681,18 +605,9 @@ void 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 @@ dw2_asm_output_data_sleb128 VPARAMS ((HOST_WIDE_INT value, #endif fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } void @@ -747,19 +662,10 @@ dw2_asm_output_delta_uleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED, 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 @@ dw2_asm_output_delta_uleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED, } fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } void @@ -785,19 +691,10 @@ dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED, 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 @@ dw2_asm_output_delta_sleb128 VPARAMS ((const char *lab1 ATTRIBUTE_UNUSED, } fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } static rtx dw2_force_const_mem PARAMS ((rtx)); @@ -912,21 +809,12 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding, 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 @@ dw2_asm_output_encoded_addr_rtx VPARAMS ((int encoding, } fputc ('\n', asm_out_file); - va_end (ap); + VA_CLOSE (ap); } diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index b41de83ddad..379bfb6b809 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -424,21 +424,13 @@ gen_lowpart_SUBREG (mode, reg) 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); - -#ifndef ANSI_PROTOTYPES - code = va_arg (p, enum rtx_code); - mode = va_arg (p, enum machine_mode); -#endif + VA_OPEN (p, mode); + VA_FIXEDARG (p, enum rtx_code, code); + VA_FIXEDARG (p, enum machine_mode, mode); switch (code) { @@ -511,7 +503,7 @@ gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...)) break; } - va_end (p); + VA_CLOSE (p); return rt_val; } @@ -525,18 +517,11 @@ gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...)) 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 @@ gen_rtvec VPARAMS ((int n, ...)) for (i = 0; i < n; i++) vector[i] = va_arg (p, rtx); - va_end (p); + VA_CLOSE (p); return gen_rtvec_v (n, vector); } diff --git a/gcc/errors.c b/gcc/errors.c index be59323e296..8d072979c35 100644 --- a/gcc/errors.c +++ b/gcc/errors.c @@ -39,20 +39,12 @@ int have_error = 0; 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 @@ warning VPARAMS ((const char *format, ...)) 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 @@ error VPARAMS ((const char *format, ...)) 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 @@ fatal VPARAMS ((const char *format, ...)) 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); } diff --git a/gcc/final.c b/gcc/final.c index f0e51e9c9b8..d524ccb9345 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3651,20 +3651,12 @@ output_addr_const (file, x) 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 @@ asm_fprintf VPARAMS ((FILE *file, const char *p, ...)) default: fputc (c, file); } - va_end (argptr); + VA_CLOSE (argptr); } /* Split up a CONST_DOUBLE or integer constant rtx diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 068cc692c6e..24cbfef35e7 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -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 @@ v_fatal (str, ap) 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); } diff --git a/gcc/gcc.c b/gcc/gcc.c index 3e2f6e4c0b9..fcb0d8483ce 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -6204,20 +6204,12 @@ fancy_abort () 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 @@ fatal VPARAMS ((const char *msgid, ...)) 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 @@ error VPARAMS ((const char *msgid, ...)) 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 diff --git a/gcc/gcov.c b/gcc/gcov.c index 4fe37b20c30..b88bf093fc0 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -273,21 +273,12 @@ static void fnotice PARAMS ((FILE *, const char *, ...)) ATTRIBUTE_PRINTF_2; static void fnotice VPARAMS ((FILE *file, const char *msgid, ...)) { -#ifndef ANSI_PROTOTYPES - FILE *file; - const char *msgid; -#endif - va_list ap; - - VA_START (ap, msgid); - -#ifndef ANSI_PROTOTYPES - file = va_arg (ap, FILE *); - msgid = va_arg (ap, const char *); -#endif + VA_OPEN (ap, msgid); + VA_FIXEDARG (ap, FILE *, file); + VA_FIXEDARG (ap, const char *, msgid); vfprintf (file, _(msgid), ap); - va_end (ap); + VA_CLOSE (ap); } /* More 'friendly' abort that prints the line and file. diff --git a/gcc/gensupport.c b/gcc/gensupport.c index fe69e05b339..bc18866ceb6 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -79,24 +79,15 @@ static void process_define_cond_exec PARAMS ((void)); void message_with_line VPARAMS ((int lineno, const char *msg, ...)) { -#ifndef ANSI_PROTOTYPES - int lineno; - const char *msg; -#endif - va_list ap; - - VA_START (ap, msg); - -#ifndef ANSI_PROTOTYPES - lineno = va_arg (ap, int); - msg = va_arg (ap, const char *); -#endif + VA_OPEN (ap, msg); + VA_FIXEDARG (ap, int, lineno); + VA_FIXEDARG (ap, const char *, msg); 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. */ diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index 61db2c7c8be..bc191db5576 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -5561,16 +5561,8 @@ free_thead (ptr) 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 @@ fatal VPARAMS ((const char *format, ...)) 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 @@ fatal VPARAMS ((const char *format, ...)) 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 @@ error VPARAMS ((const char *format, ...)) fprintf (stderr, "line:\t%s\n", cur_line_start); had_errors++; - va_end (ap); + VA_CLOSE (ap); saber_stop (); } diff --git a/gcc/protoize.c b/gcc/protoize.c index 92b4b513388..98a0940c172 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -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 char * saved_repl_write_ptr; 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); } diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c index 959a6f342df..9342a279a8e 100644 --- a/gcc/read-rtl.c +++ b/gcc/read-rtl.c @@ -53,21 +53,13 @@ const char *read_rtx_filename = "<unknown>"; 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); - -#ifndef ANSI_PROTOTYPES - infile = va_arg (ap, FILE *); - msg = va_arg (ap, const char *); -#endif + VA_OPEN (ap, msg); + VA_FIXEDARG (ap, FILE *, infile); + VA_FIXEDARG (ap, const char *, msg); fprintf (stderr, "%s:%d: ", read_rtx_filename, read_rtx_lineno); vfprintf (stderr, msg, ap); @@ -88,7 +80,7 @@ fatal_with_file_and_line VPARAMS ((FILE *infile, const char *msg, ...)) fprintf (stderr, "%s:%d: following context is `%s'\n", read_rtx_filename, read_rtx_lineno, context); - va_end (ap); + VA_CLOSE (ap); exit (1); } diff --git a/gcc/rtl-error.c b/gcc/rtl-error.c index 3acb507b383..7515f527f92 100644 --- a/gcc/rtl-error.c +++ b/gcc/rtl-error.c @@ -91,41 +91,23 @@ diagnostic_for_asm (insn, msg, args_ptr, warn) void error_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 = */ 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 diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c index 7d5e11050ec..69848860dc5 100644 --- a/gcc/tradcpp.c +++ b/gcc/tradcpp.c @@ -4686,37 +4686,22 @@ v_message (mtype, line, msgid, ap) 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 @@ error_from_errno (name) 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); } diff --git a/gcc/tree.c b/gcc/tree.c index b4e483d3538..e5bc8d8dba9 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -2334,23 +2334,15 @@ stabilize_reference_1 (e) 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 @@ build VPARAMS ((enum tree_code code, tree tt, ...)) } } } - va_end (p); + VA_CLOSE (p); TREE_CONSTANT (t) = constant; return t; @@ -2518,19 +2510,12 @@ build1 (code, type, node) 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 @@ build_nt VPARAMS ((enum tree_code code, ...)) for (i = 0; i < length; i++) TREE_OPERAND (t, i) = va_arg (p, tree); - va_end (p); + VA_CLOSE (p); return t; } |