From fbd40359903dd76a65dea95c8782cc47f28fbc77 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 20 May 2000 19:45:36 +0000 Subject: top level: * diagnostic.c: Eliminate implicit int. * except.c, gcc.c: Add static prototypes. * final.c (final_end_function): Mark file arg ATTRIBUTE_UNUSED. * gensupport.c (process_rtx): Use XVEC to initialize vector slot of 'split'. * print-rtl.c: If DEBUG_REGISTER_NAMES, define static debug_reg_names instead of static reg_names. If not, define global reg_names. * regclass.c: Don't define global reg_names unless DEBUG_REGISTER_NAMES is defined. * reload1.c (order_regs_for_reload): Remove unused variable. * varasm.c: Include output.h after defaults.h. Define eh_frame_section as function of no args, not of unspecified args. * gcc.c: Constify argbuf; arguments to store_arg, process_command, main; elements of struct command and struct switchstr; local variables in execute, process_command, main. cp: * except.c: Add static prototypes. From-SVN: r34054 --- gcc/ChangeLog | 22 ++++++++++++++++++++++ gcc/cp/ChangeLog | 4 ++++ gcc/cp/except.c | 2 ++ gcc/diagnostic.c | 2 +- gcc/except.c | 2 +- gcc/final.c | 2 +- gcc/gcc.c | 54 ++++++++++++++++++++++++++++++------------------------ gcc/gensupport.c | 2 +- gcc/print-rtl.c | 5 +++-- gcc/regclass.c | 5 ++++- gcc/reload1.c | 10 +++++----- gcc/varasm.c | 4 ++-- 12 files changed, 76 insertions(+), 38 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c7e055..6d2bc42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,25 @@ +2000-05-20 Zack Weinberg + + * diagnostic.c: Eliminate implicit int. + * except.c, gcc.c: Add static prototypes. + * final.c (final_end_function): Mark file arg ATTRIBUTE_UNUSED. + * gensupport.c (process_rtx): Use XVEC to initialize vector + slot of 'split'. + + * print-rtl.c: If DEBUG_REGISTER_NAMES, define static + debug_reg_names instead of static reg_names. If not, define + global reg_names. + * regclass.c: Don't define global reg_names unless + DEBUG_REGISTER_NAMES is defined. + + * reload1.c (order_regs_for_reload): Remove unused variable. + * varasm.c: Include output.h after defaults.h. Define + eh_frame_section as function of no args, not of unspecified args. + + * gcc.c: Constify argbuf; arguments to store_arg, + process_command, main; elements of struct command and struct + switchstr; local variables in execute, process_command, main. + 2000-05-20 Bruce Korb * fixinc/inclhack.def: more applications of c_fix=format + tests diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 01d9e2e..d2a84fb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2000-05-20 Zack Weinberg + + * except.c: Add static prototypes. + 2000-05-20 H.J. Lu * Make-lang.in (cplib2.ready): Also depend on cc1plus$(exeext). diff --git a/gcc/cp/except.c b/gcc/cp/except.c index ce8535a..91f75c2 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -54,6 +54,8 @@ static tree build_eh_type_type_ref PARAMS ((tree)); static tree build_terminate_handler PARAMS ((void)); static tree alloc_eh_object PARAMS ((tree)); static int complete_ptr_ref_or_void_ptr_p PARAMS ((tree, tree)); +static int can_convert_eh PARAMS ((tree, tree)); +static void check_handlers_1 PARAMS ((tree, tree)); static void initialize_handler_parm PARAMS ((tree)); static tree expand_throw PARAMS ((tree)); static int decl_is_java_type PARAMS ((tree decl, int err)); diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 5c498c9..f559d68 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -112,7 +112,7 @@ static int output_maximum_width = 0; /* Used to control every diagnostic message formatting. Front-ends should call set_message_prefixing_rule to set up their politics. */ -static current_prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE; +static int current_prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE; /* Predicate. Return 1 if we're in automatic line wrapping mode. */ diff --git a/gcc/except.c b/gcc/except.c index 2926b5a..00816ef 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -470,6 +470,7 @@ static void set_insn_eh_region PARAMS ((rtx *, int)); #ifdef DONT_USE_BUILTIN_SETJMP static void jumpif_rtx PARAMS ((rtx, rtx)); #endif +static void find_exception_handler_labels_1 PARAMS ((rtx)); static void mark_eh_node PARAMS ((struct eh_node *)); static void mark_eh_stack PARAMS ((struct eh_stack *)); static void mark_eh_queue PARAMS ((struct eh_queue *)); @@ -483,7 +484,6 @@ static int find_func_region PARAMS ((int)); static int find_func_region_from_symbol PARAMS ((rtx)); static void clear_function_eh_region PARAMS ((void)); static void process_nestinfo PARAMS ((int, eh_nesting_info *, int *)); - rtx expand_builtin_return_addr PARAMS ((enum built_in_function, int, rtx)); static void emit_cleanup_handler PARAMS ((struct eh_entry *)); static int eh_region_from_symbol PARAMS ((rtx)); diff --git a/gcc/final.c b/gcc/final.c index 1aedfa3..e24471c 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1779,7 +1779,7 @@ profile_function (file) void final_end_function (first, file, optimize) rtx first ATTRIBUTE_UNUSED; - FILE *file; + FILE *file ATTRIBUTE_UNUSED; int optimize ATTRIBUTE_UNUSED; { app_disable (); diff --git a/gcc/gcc.c b/gcc/gcc.c index 334e72b..a8946a3 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -199,6 +199,8 @@ static char **split_directories PARAMS ((const char *, int *)); static void free_split_directories PARAMS ((char **)); static char *make_relative_prefix PARAMS ((const char *, const char *, const char *)); #endif /* VMS */ +static void store_arg PARAMS ((const char *, int, int)); +static char *load_specs PARAMS ((const char *)); static void read_specs PARAMS ((const char *, int)); static void set_spec PARAMS ((const char *, const char *)); static struct compiler *lookup_compiler PARAMS ((const char *, size_t, const char *)); @@ -208,6 +210,7 @@ static int access_check PARAMS ((const char *, int)); static char *find_a_file PARAMS ((struct path_prefix *, const char *, int)); static void add_prefix PARAMS ((struct path_prefix *, const char *, const char *, int, int, int *)); +static void translate_options PARAMS ((int *, const char ***)); static char *skip_whitespace PARAMS ((char *)); static void record_temp_file PARAMS ((const char *, int, int)); static void delete_if_ordinary PARAMS ((const char *)); @@ -239,7 +242,7 @@ static void display_help PARAMS ((void)); static void add_preprocessor_option PARAMS ((const char *, int)); static void add_assembler_option PARAMS ((const char *, int)); static void add_linker_option PARAMS ((const char *, int)); -static void process_command PARAMS ((int, char **)); +static void process_command PARAMS ((int, const char **)); static int execute PARAMS ((void)); static void unused_prefix_warnings PARAMS ((struct path_prefix *)); static void clear_args PARAMS ((void)); @@ -1287,7 +1290,7 @@ set_spec (name, spec) /* Vector of pointers to arguments in the current line of specifications. */ -static char **argbuf; +static const char **argbuf; /* Number of elements allocated in argbuf. */ @@ -1437,12 +1440,13 @@ clear_args () static void store_arg (arg, delete_always, delete_failure) - char *arg; + const char *arg; int delete_always, delete_failure; { if (argbuf_index + 1 == argbuf_length) argbuf - = (char **) xrealloc (argbuf, (argbuf_length *= 2) * sizeof (char *)); + = (const char **) xrealloc (argbuf, + (argbuf_length *= 2) * sizeof (const char *)); argbuf[argbuf_index++] = arg; argbuf[argbuf_index] = 0; @@ -2504,7 +2508,7 @@ execute () struct command { const char *prog; /* program name. */ - char **argv; /* vector of args. */ + const char **argv; /* vector of args. */ int pid; /* pid of process for this command. */ }; @@ -2558,7 +2562,7 @@ execute () /* Print each piped command as a separate line. */ for (i = 0; i < n_commands ; i++) { - char **j; + const char **j; for (j = commands[i].argv; *j; j++) fprintf (stderr, " %s", *j); @@ -2587,7 +2591,7 @@ execute () for (i = 0; i < n_commands; i++) { char *errmsg_fmt, *errmsg_arg; - char *string = commands[i].argv[0]; + const char *string = commands[i].argv[0]; commands[i].pid = pexecute (string, commands[i].argv, programname, temp_filename, @@ -2602,7 +2606,7 @@ execute () pfatal_pexecute (errmsg_fmt, errmsg_arg); if (string != commands[i].prog) - free (string); + free ((PTR) string); } execution_count++; @@ -2703,7 +2707,7 @@ execute () struct switchstr { const char *part1; - char **args; + const char **args; int live_cond; int validated; }; @@ -2909,12 +2913,12 @@ add_linker_option (option, len) static void process_command (argc, argv) int argc; - char **argv; + const char **argv; { register int i; const char *temp; char *temp1; - char *spec_lang = 0; + const char *spec_lang = 0; int last_language_n_infiles; int have_c = 0; int have_o = 0; @@ -3229,7 +3233,7 @@ process_command (argc, argv) report_times = 1; else if (argv[i][0] == '-' && argv[i][1] != 0) { - register char *p = &argv[i][1]; + register const char *p = &argv[i][1]; register int c = *p; switch (c) @@ -3248,7 +3252,7 @@ process_command (argc, argv) case 'B': { - char *value; + const char *value; if (p[1] == 0 && i + 1 == argc) fatal ("argument to `-B' is missing"); if (p[1] == 0) @@ -3586,8 +3590,8 @@ process_command (argc, argv) } else if (argv[i][0] == '-' && argv[i][1] != 0) { - register char *p = &argv[i][1]; - register int c = *p; + const char *p = &argv[i][1]; + int c = *p; if (c == 'x') { @@ -3622,7 +3626,7 @@ process_command (argc, argv) if (i + n_args >= argc) fatal ("argument to `-%s' is missing", p); switches[n_switches].args - = (char **) xmalloc ((n_args + 1) * sizeof (char *)); + = (const char **) xmalloc ((n_args + 1) * sizeof(const char *)); while (j < n_args) switches[n_switches].args[j++] = argv[++i]; /* Null-terminate the vector. */ @@ -3633,13 +3637,15 @@ process_command (argc, argv) /* On some systems, ld cannot handle some options without a space. So split the option from its argument. */ char *part1 = (char *) xmalloc (2); + char *tmp; part1[0] = c; part1[1] = '\0'; switches[n_switches].part1 = part1; - switches[n_switches].args = (char **) xmalloc (2 * sizeof (char *)); - switches[n_switches].args[0] = xmalloc (strlen (p)); - strcpy (switches[n_switches].args[0], &p[1]); + switches[n_switches].args + = (const char **) xmalloc (2 * sizeof (const char *)); + switches[n_switches].args[0] = tmp = xmalloc (strlen (p)); + strcpy (tmp, &p[1]); switches[n_switches].args[1] = 0; } else @@ -4982,7 +4988,7 @@ give_switch (switchnum, omit_first_word, include_blanks) if (switches[switchnum].args != 0) { - char **p; + const char **p; for (p = switches[switchnum].args; *p; p++) { if (include_blanks) @@ -5124,12 +5130,12 @@ fatal_error (signum) kill (getpid (), signum); } -extern int main PARAMS ((int, char **)); +extern int main PARAMS ((int, const char **)); int main (argc, argv) int argc; - char **argv; + const char **argv; { register size_t i; size_t j; @@ -5165,7 +5171,7 @@ main (argc, argv) #endif argbuf_length = 10; - argbuf = (char **) xmalloc (argbuf_length * sizeof (char *)); + argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *)); obstack_init (&obstack); @@ -5250,7 +5256,7 @@ main (argc, argv) first_time = TRUE; for (i = 0; (int)i < n_switches; i++) { - char **args; + const char **args; const char *p, *q; if (!first_time) obstack_grow (&collect_obstack, " ", 1); diff --git a/gcc/gensupport.c b/gcc/gensupport.c index 120614b..b475523 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -180,7 +180,7 @@ process_rtx (desc, lineno) split = rtx_alloc (DEFINE_SPLIT); i = XVECLEN (desc, 1); - XEXP (split, 0) = rtvec_alloc (i); + XVEC (split, 0) = rtvec_alloc (i); while (--i >= 0) { XVECEXP (split, 0, i) = copy_rtx (XVECEXP (desc, 1, i)); diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 544e544..e52a410 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -39,9 +39,10 @@ Boston, MA 02111-1307, USA. */ /* Array containing all of the register names */ #ifdef DEBUG_REGISTER_NAMES -static const char * const reg_names[] = DEBUG_REGISTER_NAMES; +static const char * const debug_reg_names[] = DEBUG_REGISTER_NAMES; +#define reg_names debug_reg_names #else -static const char * const reg_names[] = REGISTER_NAMES; +const char * const reg_names[] = REGISTER_NAMES; #endif static FILE *outfile; diff --git a/gcc/regclass.c b/gcc/regclass.c index f4ed192..1ffbb33 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -160,9 +160,12 @@ enum reg_class reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES]; enum reg_class reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES]; -/* Array containing all of the register names */ +/* Array containing all of the register names. Unless + DEBUG_REGISTER_NAMES is defined, use the copy in print-rtl.c. */ +#ifdef DEBUG_REGISTER_NAMES const char * const reg_names[] = REGISTER_NAMES; +#endif /* For each hard register, the widest mode object that it can contain. This will be a MODE_INT mode if the register can hold integers. Otherwise diff --git a/gcc/reload1.c b/gcc/reload1.c index 3ff2b45..e7da78b 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1518,7 +1518,7 @@ static void order_regs_for_reload (chain) struct insn_chain *chain; { - register int i, j; + int i; HARD_REG_SET used_by_pseudos; HARD_REG_SET used_by_pseudos2; @@ -1541,14 +1541,14 @@ order_regs_for_reload (chain) CLEAR_REG_SET (&pseudos_counted); EXECUTE_IF_SET_IN_REG_SET - (&chain->live_throughout, FIRST_PSEUDO_REGISTER, j, + (&chain->live_throughout, FIRST_PSEUDO_REGISTER, i, { - count_pseudo (j); + count_pseudo (i); }); EXECUTE_IF_SET_IN_REG_SET - (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, j, + (&chain->dead_or_set, FIRST_PSEUDO_REGISTER, i, { - count_pseudo (j); + count_pseudo (i); }); CLEAR_REG_SET (&pseudos_counted); } diff --git a/gcc/varasm.c b/gcc/varasm.c index b92bf3c..85755b7 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -35,10 +35,10 @@ Boston, MA 02111-1307, USA. */ #include "flags.h" #include "function.h" #include "expr.h" -#include "output.h" #include "hard-reg-set.h" #include "regs.h" #include "defaults.h" +#include "output.h" #include "real.h" #include "toplev.h" #include "dbxout.h" @@ -427,7 +427,7 @@ asm_output_aligned_bss (file, decl, name, size, align) #ifdef EH_FRAME_SECTION_ASM_OP void -eh_frame_section () +eh_frame_section (void) { if (in_section != in_eh_frame) { -- cgit v1.1