diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-09-12 17:18:03 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-09-12 17:18:03 +0000 |
commit | 27c38fbec7e6372600791cdb5d2dc7b0538f06d2 (patch) | |
tree | 7c832be5f376ac60e2a337dcecd71f3d30e9207d /gcc | |
parent | 19dab7952cfedc4e896ce817b4221af7b042e080 (diff) | |
download | gcc-27c38fbec7e6372600791cdb5d2dc7b0538f06d2.zip gcc-27c38fbec7e6372600791cdb5d2dc7b0538f06d2.tar.gz gcc-27c38fbec7e6372600791cdb5d2dc7b0538f06d2.tar.bz2 |
c-common.c (c_tree_code_name): Const-ification.
* c-common.c (c_tree_code_name): Const-ification.
* c-decl.c (c_decode_option): Likewise.
* c-typeck.c (warn_for_assignment): Likewise.
* collect2.c (libexts, is_ctor_dtor, main, ignore_library):
Likewise.
* cppinit.c (output_deps): Likewise.
* dependence.c (dependence_string, direction_string): Likewise.
* dwarf2out.c (output_ranges): Likewise.
* fixinc/fixfixes.c (emit_gnu_type): Likewise.
* fixinc/gnu-regex.c (re_error_msgid): Likewise.
* gcc.c (standard_exec_prefix, standard_exec_prefix_1,
standard_startfile_prefix, standard_startfile_prefix_1,
standard_startfile_prefix_2, tooldir_base_prefix,
standard_bindir_prefix, find_a_file): Likewise.
* genattrtab.c (make_length_attrs): Likewise.
* gencheck.c (tree_codes): Likewise.
* genemit.c (gen_split): Likewise.
* genrecog.c (special_mode_pred_table): Likewise.
* graph.c (graph_ext): Likewise.
* protoize (default_include): Likewise.
* reload.c (reload_when_needed_name): Likewise.
* sched-vis.c (visualize_stall_cycles): Likewise.
* tlink.c (recompile_files): Likewise.
* toplev.c (decode_g_option): Likewise.
* tradcpp.c (output_deps): Likewise.
* varasm.c (decode_reg_name): Likewise.
* arm.c (arm_condition_codes, strings_fpa, thumb_condition_code):
Const-ification.
* arm.md: Likewise.
* avr.c (avr_regnames, encode_section_info): Likewise.
* c4x.c (float_reg_names): Likewise.
* darwin.h (ASM_GLOBALIZE_LABEL): Likewise.
* elfos.h (const_section): Likewise.
* i386.c (ix86_comp_type_attributes): Likewise.
* i386/win32.h (STRIP_NAME_ENCODING): Likewise.
* ia64/aix.h (UNIQUE_SECTION): Likewise.
* ia64.c (type_names): Likewise.
* m68hc11.c (reg_class_names): Likewise.
* m88k.c (m_options): Likewise.
* mips.c (mips_output_conditional_branch, mips_unique_section):
Likewise.
* rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise.
* sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue,
ultra_code_names): Likewise.
* sparc.h (OVERRIDE_OPTIONS): Likewise.
From-SVN: r45567
Diffstat (limited to 'gcc')
40 files changed, 124 insertions, 75 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3af42a0..edd2ad7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,52 @@ +2001-09-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * c-common.c (c_tree_code_name): Const-ification. + * c-decl.c (c_decode_option): Likewise. + * c-typeck.c (warn_for_assignment): Likewise. + * collect2.c (libexts, is_ctor_dtor, main, ignore_library): + Likewise. + * cppinit.c (output_deps): Likewise. + * dependence.c (dependence_string, direction_string): Likewise. + * dwarf2out.c (output_ranges): Likewise. + * fixinc/fixfixes.c (emit_gnu_type): Likewise. + * fixinc/gnu-regex.c (re_error_msgid): Likewise. + * gcc.c (standard_exec_prefix, standard_exec_prefix_1, + standard_startfile_prefix, standard_startfile_prefix_1, + standard_startfile_prefix_2, tooldir_base_prefix, + standard_bindir_prefix, find_a_file): Likewise. + * genattrtab.c (make_length_attrs): Likewise. + * gencheck.c (tree_codes): Likewise. + * genemit.c (gen_split): Likewise. + * genrecog.c (special_mode_pred_table): Likewise. + * graph.c (graph_ext): Likewise. + * protoize (default_include): Likewise. + * reload.c (reload_when_needed_name): Likewise. + * sched-vis.c (visualize_stall_cycles): Likewise. + * tlink.c (recompile_files): Likewise. + * toplev.c (decode_g_option): Likewise. + * tradcpp.c (output_deps): Likewise. + * varasm.c (decode_reg_name): Likewise. + + * arm.c (arm_condition_codes, strings_fpa, thumb_condition_code): + Const-ification. + * arm.md: Likewise. + * avr.c (avr_regnames, encode_section_info): Likewise. + * c4x.c (float_reg_names): Likewise. + * darwin.h (ASM_GLOBALIZE_LABEL): Likewise. + * elfos.h (const_section): Likewise. + * i386.c (ix86_comp_type_attributes): Likewise. + * i386/win32.h (STRIP_NAME_ENCODING): Likewise. + * ia64/aix.h (UNIQUE_SECTION): Likewise. + * ia64.c (type_names): Likewise. + * m68hc11.c (reg_class_names): Likewise. + * m88k.c (m_options): Likewise. + * mips.c (mips_output_conditional_branch, mips_unique_section): + Likewise. + * rs6000/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Likewise. + * sparc.c (sparc_flat_function_prologue, sparc_flat_function_epilogue, + ultra_code_names): Likewise. + * sparc.h (OVERRIDE_OPTIONS): Likewise. + 2001-09-12 Jakub Jelinek <jakub@redhat.com> * configure.in (gcc_cv_as_shf_merge): Fix a typo. diff --git a/gcc/c-common.c b/gcc/c-common.c index 91f4b0a..755e526 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4074,7 +4074,7 @@ static int c_tree_code_length[] = { Used for printing out the tree and error messages. */ #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME, -static const char *c_tree_code_name[] = { +static const char *const c_tree_code_name[] = { "@@dummy", #include "c-common.def" }; diff --git a/gcc/c-decl.c b/gcc/c-decl.c index af61377..d0beb0f 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -490,7 +490,7 @@ c_decode_option (argc, argv) -std=gnu89 default, iso9899:1990 + gnu extensions -std=gnu99 iso9899:1999 + gnu extensions */ - const char *argstart = &p[5]; + const char *const argstart = &p[5]; if (!strcmp (argstart, "iso9899:1990") || !strcmp (argstart, "c89")) diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index e28fa39..444a104 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -4319,7 +4319,7 @@ warn_for_assignment (msgid, opname, function, argnum) if (function) { /* Function name is known; supply it. */ - const char *argstring = _("passing arg %d of `%s'"); + const char *const argstring = _("passing arg %d of `%s'"); new_opname = (char *) alloca (IDENTIFIER_LENGTH (function) + strlen (argstring) + 1 + 25 /*%d*/ + 1); @@ -4329,7 +4329,7 @@ warn_for_assignment (msgid, opname, function, argnum) else { /* Function name unknown (call through ptr); just give arg number.*/ - const char *argnofun = _("passing arg %d of pointer to function"); + const char *const argnofun = _("passing arg %d of pointer to function"); new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1); sprintf (new_opname, argnofun, argnum); } diff --git a/gcc/collect2.c b/gcc/collect2.c index 3405f6e..44f7e3a 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -264,7 +264,7 @@ static struct path_prefix cmdline_lib_dirs; /* directories specified with -L */ static struct path_prefix libpath_lib_dirs; /* directories in LIBPATH */ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs, &libpath_lib_dirs, NULL}; -static const char *libexts[3] = {"a", "so", NULL}; /* possible library extentions */ +static const char *const libexts[3] = {"a", "so", NULL}; /* possible library extentions */ #endif static void handler PARAMS ((int)); @@ -557,7 +557,7 @@ static int is_ctor_dtor (s) const char *s; { - struct names { const char *name; int len; int ret; int two_underscores; }; + struct names { const char *const name; int len; int ret; int two_underscores; }; register struct names *p; register int ch; @@ -796,21 +796,21 @@ main (argc, argv) int argc; char *argv[]; { - const char *ld_suffix = "ld"; + const char *const ld_suffix = "ld"; const char *full_ld_suffix = ld_suffix; - const char *real_ld_suffix = "real-ld"; - const char *collect_ld_suffix = "collect-ld"; - const char *nm_suffix = "nm"; + const char *const real_ld_suffix = "real-ld"; + const char *const collect_ld_suffix = "collect-ld"; + const char *const nm_suffix = "nm"; const char *full_nm_suffix = nm_suffix; - const char *gnm_suffix = "gnm"; + const char *const gnm_suffix = "gnm"; const char *full_gnm_suffix = gnm_suffix; #ifdef LDD_SUFFIX - const char *ldd_suffix = LDD_SUFFIX; + const char *const ldd_suffix = LDD_SUFFIX; const char *full_ldd_suffix = ldd_suffix; #endif - const char *strip_suffix = "strip"; + const char *const strip_suffix = "strip"; const char *full_strip_suffix = strip_suffix; - const char *gstrip_suffix = "gstrip"; + const char *const gstrip_suffix = "gstrip"; const char *full_gstrip_suffix = gstrip_suffix; const char *arg; FILE *outf; @@ -2907,7 +2907,7 @@ if (debug) fprintf (stderr, "found: %s\n", lib_buf); /* Array of standard AIX libraries which should not be scanned for ctors/dtors. */ -static const char *aix_std_libs[] = { +static const char *const aix_std_libs[] = { "/unix", "/lib/libc.a", "/lib/libm.a", @@ -2931,7 +2931,7 @@ static int ignore_library (name) const char *name; { - const char **p = &aix_std_libs[0]; + const char *const *p = &aix_std_libs[0]; while (*p++ != NULL) if (! strcmp (name, *p)) return 1; return 0; diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 725864c..4445583 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -283,7 +283,7 @@ rtx arm_target_insn; int arm_target_label; /* The condition codes of the ARM, and the inverse function. */ -const char * arm_condition_codes[] = +const char *const arm_condition_codes[] = { "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le", "al", "nv" @@ -2834,7 +2834,7 @@ arm_adjust_cost (insn, link, dep, cost) static int fpa_consts_inited = 0; -static const char * strings_fpa[8] = +static const char *const strings_fpa[8] = { "0", "1", "2", "3", "4", "5", "0.5", "10" @@ -10609,7 +10609,7 @@ thumb_condition_code (x, invert) rtx x; int invert; { - static const char * conds[] = + static const char *const conds[] = { "eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le" diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 784f28f..a3cc4f3 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -61,7 +61,7 @@ typedef enum arm_cond_code arm_cc; extern arm_cc arm_current_cc; -extern const char * arm_condition_codes[]; +extern const char *const arm_condition_codes[]; #define ARM_INVERSE_CONDITION_CODE(X) ((arm_cc) (((int)X) ^ 1)) @@ -2800,7 +2800,7 @@ extern int making_const_table; do \ { \ int mi_delta = (DELTA); \ - const char * mi_op = mi_delta < 0 ? "sub" : "add"; \ + const char *const mi_op = mi_delta < 0 ? "sub" : "add"; \ int shift = 0; \ int this_regno = (aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) \ ? 1 : 0); \ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 5565aee..347bc33 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -7371,7 +7371,7 @@ "TARGET_ARM" "* { - const char * opcodes[4][2] = + static const char *const opcodes[4][2] = { {\"cmp\\t%2, %3\;cmp%d5\\t%0, %1\", \"cmp\\t%0, %1\;cmp%d4\\t%2, %3\"}, @@ -7406,7 +7406,7 @@ "TARGET_ARM" "* { - const char * opcodes[4][2] = + static const char *const opcodes[4][2] = { {\"cmp\\t%0, %1\;cmp%D4\\t%2, %3\", \"cmp\\t%2, %3\;cmp%D5\\t%0, %1\"}, diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index cb222b2..a6cb331 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -77,7 +77,7 @@ rtx zero_reg_rtx; rtx ldi_reg_rtx; /* AVR register names {"r0", "r1", ..., "r31"} */ -const char * avr_regnames[] = REGISTER_NAMES; +static const char *const avr_regnames[] = REGISTER_NAMES; /* This holds the last insn address. */ static int last_insn_address = 0; @@ -4756,7 +4756,7 @@ encode_section_info (decl) && TREE_CODE (decl) == VAR_DECL && avr_progmem_p (decl)) { - const char *dsec = ".progmem.data"; + const char *const dsec = ".progmem.data"; DECL_SECTION_NAME (decl) = build_string (strlen (dsec), dsec); TREE_READONLY (decl) = 1; } diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 2e79177..872cdfd 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -65,7 +65,7 @@ rtx floatunshihf2_libfunc; static int c4x_leaf_function; -static const char *float_reg_names[] = FLOAT_REGISTER_NAMES; +static const char *const float_reg_names[] = FLOAT_REGISTER_NAMES; /* Array of the smallest class containing reg number REGNO, indexed by REGNO. Used by REGNO_REG_CLASS in c4x.h. We assume that all these diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 5c49d113..72c689b 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -669,7 +669,7 @@ void alias_section (name, alias) \ #undef ASM_GLOBALIZE_LABEL #define ASM_GLOBALIZE_LABEL(FILE,NAME) \ - do { const char* _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \ + do { const char *const _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \ (fputs (".globl ", FILE), assemble_name (FILE, _x), fputs ("\n", FILE)); \ }} while (0) diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index d2ae669..66b0db7 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -313,7 +313,7 @@ const_section () \ const char *name; \ char *string; \ const char *prefix; \ - static const char *prefixes[4][2] = \ + static const char *const prefixes[4][2] = \ { \ { ".text.", ".gnu.linkonce.t." }, \ { ".rodata.", ".gnu.linkonce.r." }, \ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index eba47bc..81058ac 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1124,7 +1124,7 @@ ix86_comp_type_attributes (type1, type2) tree type2; { /* Check for mismatch of non-default calling convention. */ - const char *rtdstr = TARGET_RTD ? "cdecl" : "stdcall"; + const char *const rtdstr = TARGET_RTD ? "cdecl" : "stdcall"; if (TREE_CODE (type1) != FUNCTION_TYPE) return 1; diff --git a/gcc/config/i386/win32.h b/gcc/config/i386/win32.h index d2ab075..fda2658 100644 --- a/gcc/config/i386/win32.h +++ b/gcc/config/i386/win32.h @@ -145,7 +145,7 @@ while (0) #define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \ do { \ const char *_p; \ - const char *_name = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*')); \ + const char *const _name = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*'));\ for (_p = _name; *_p && *_p != '@'; ++_p) \ ; \ if (*_p == '@') \ diff --git a/gcc/config/ia64/aix.h b/gcc/config/ia64/aix.h index 0c63211..8366824 100644 --- a/gcc/config/ia64/aix.h +++ b/gcc/config/ia64/aix.h @@ -204,7 +204,7 @@ extern unsigned int ia64_section_threshold; const char *name; \ char *string; \ const char *prefix; \ - static const char *prefixes[/*4*/3][2] = \ + static const char *const prefixes[/*4*/3][2] = \ { \ { ".text.", ".gnu.linkonce.t." }, \ { ".rodata.", ".gnu.linkonce.r." }, \ diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index ea1cf10..c173b54 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -5079,7 +5079,7 @@ static struct ia64_packet packets[NR_PACKETS]; /* Map attr_type to a string with the name. */ -static const char *type_names[] = +static const char *const type_names[] = { "UNKNOWN", "A", "I", "M", "F", "B", "L", "X", "S" }; diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index 04516fe..3bd9ce6 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -301,7 +301,7 @@ m68hc11_conditional_register_usage () /* Reload and register operations. */ -static const char *reg_class_names[] = REG_CLASS_NAMES; +static const char *const reg_class_names[] = REG_CLASS_NAMES; void diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c index 34ca914..994994b 100644 --- a/gcc/config/m88k/m88k.c +++ b/gcc/config/m88k/m88k.c @@ -1534,7 +1534,7 @@ output_option (file, sep, type, name, indent, pos, max) return pos + fprintf (file, "%s%s%s", sep, type, name); } -static struct { const char *name; int value; } m_options[] = TARGET_SWITCHES; +static struct { const char *const name; int value; } m_options[] = TARGET_SWITCHES; static void output_options (file, f_options, f_len, W_options, W_len, diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index d54854a..5ac7be1 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -9445,9 +9445,9 @@ mips_output_conditional_branch (insn, operand. */ const char *op2 = (two_operands_p ? ",%z3" : ",%."); /* The operand-printing string for the comparison. */ - const char *comp = (float_p ? "%F0" : "%C0"); + const char *const comp = (float_p ? "%F0" : "%C0"); /* The operand-printing string for the inverted comparison. */ - const char *inverted_comp = (float_p ? "%W0" : "%N0"); + const char *const inverted_comp = (float_p ? "%W0" : "%N0"); /* The MIPS processors (for levels of the ISA at least two), have "likely" variants of each branch instruction. These instructions @@ -9801,7 +9801,7 @@ mips_unique_section (decl, reloc) int len, size, sec; const char *name, *prefix; char *string; - static const char *prefixes[4][2] = { + static const char *const prefixes[4][2] = { { ".text.", ".gnu.linkonce.t." }, { ".rodata.", ".gnu.linkonce.r." }, { ".data.", ".gnu.linkonce.d." }, diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index 1b2051d..38fcb83 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -630,7 +630,7 @@ extern int rs6000_pic_labelno; #undef ASM_DECLARE_FUNCTION_NAME #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ do { \ - const char *init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ + const char *const init_ptr = (TARGET_64BIT) ? ".quad" : ".long"; \ \ if (TARGET_RELOCATABLE && (get_pool_size () != 0 || profile_flag) \ && uses_TOC()) \ diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 91deb49..3b11a3f 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -6701,8 +6701,8 @@ sparc_flat_function_prologue (file, size) if (size > 0) { unsigned int reg_offset = current_frame_info.reg_offset; - const char *fp_str = reg_names[FRAME_POINTER_REGNUM]; - const char *t1_str = "%g1"; + const char *const fp_str = reg_names[FRAME_POINTER_REGNUM]; + const char *const t1_str = "%g1"; /* Things get a little tricky if local variables take up more than ~4096 bytes and outgoing arguments take up more than ~4096 bytes. When that @@ -6885,9 +6885,9 @@ sparc_flat_function_epilogue (file, size) { unsigned HOST_WIDE_INT reg_offset = current_frame_info.reg_offset; unsigned HOST_WIDE_INT size1; - const char *sp_str = reg_names[STACK_POINTER_REGNUM]; - const char *fp_str = reg_names[FRAME_POINTER_REGNUM]; - const char *t1_str = "%g1"; + const char *const sp_str = reg_names[STACK_POINTER_REGNUM]; + const char *const fp_str = reg_names[FRAME_POINTER_REGNUM]; + const char *const t1_str = "%g1"; /* In the reload sequence, we don't need to fill the load delay slots for most of the loads, also see if we can fill the final @@ -7380,7 +7380,7 @@ enum ultra_code { NONE=0, /* no insn at all */ static enum ultra_code ultra_code_from_mask PARAMS ((int)); static void ultra_schedule_insn PARAMS ((rtx *, rtx *, int, enum ultra_code)); -static const char *ultra_code_names[NUM_ULTRA_CODES] = { +static const char *const ultra_code_names[NUM_ULTRA_CODES] = { "NONE", "IEU0", "IEU1", "IEUN", "LSU", "CTI", "FPM", "FPA", "SINGLE" }; diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index 629286e..9835881 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -400,7 +400,7 @@ Unrecognized value in TARGET_CPU_DEFAULT. { \ if (flag_pic) \ { \ - const char *pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC";\ + const char *const pic_string = (flag_pic == 1) ? "-fpic" : "-fPIC";\ warning ("%s and profiling conflict: disabling %s", \ pic_string, pic_string); \ flag_pic = 0; \ diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 8029746..238cab4 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -1032,7 +1032,8 @@ output_deps (pfile) { /* Stream on which to print the dependency information. */ FILE *deps_stream = 0; - const char *deps_mode = CPP_OPTION (pfile, print_deps_append) ? "a" : "w"; + const char *const deps_mode = + CPP_OPTION (pfile, print_deps_append) ? "a" : "w"; if (CPP_OPTION (pfile, deps_file) == 0) deps_stream = stdout; diff --git a/gcc/dependence.c b/gcc/dependence.c index 4bac694..5b1017e 100644 --- a/gcc/dependence.c +++ b/gcc/dependence.c @@ -61,11 +61,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA enum dependence_type {dt_flow, dt_anti, dt_output, dt_none}; #if 0 -static const char * dependence_string [] = {"flow", "anti", "output", "none"}; +static const char *const dependence_string [] = {"flow", "anti", "output", "none"}; #endif enum direction_type {lt, le, eq, gt, ge, star, independent, undef}; #if 0 -static const char * direction_string [] = {"<", "<=", "=", ">", ">=", "*", +static const char *const direction_string [] = {"<", "<=", "=", ">", ">=", "*", "INDEPENDENT", "UNDEFINED"}; #endif enum def_use_type {def, use, init_def_use}; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 739e629..d61f77f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -6508,7 +6508,7 @@ static void output_ranges () { register unsigned i; - const char *start_fmt = "Offset 0x%x"; + const char *const start_fmt = "Offset 0x%x"; const char *fmt = start_fmt; for (i = 0; i < ranges_table_in_use; ++i) diff --git a/gcc/fixinc/fixfixes.c b/gcc/fixinc/fixfixes.c index afdecfc..a58c927 100644 --- a/gcc/fixinc/fixfixes.c +++ b/gcc/fixinc/fixfixes.c @@ -164,7 +164,7 @@ emit_gnu_type ( text, rm ) typedef __%s_TYPE__ %s_t;\n\ #endif\n"; - const char* pz_guard = (strcmp (z_type, "wchar") == 0) + const char *const pz_guard = (strcmp (z_type, "wchar") == 0) ? " && ! defined(__cplusplus)" : ""; printf (z_fmt, z_TYPE, pz_guard, z_TYPE, z_TYPE, z_type); diff --git a/gcc/fixinc/gnu-regex.c b/gcc/fixinc/gnu-regex.c index 99786e2..c4a8244 100644 --- a/gcc/fixinc/gnu-regex.c +++ b/gcc/fixinc/gnu-regex.c @@ -947,7 +947,7 @@ weak_alias (__re_set_syntax, re_set_syntax) POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ -static const char *re_error_msgid[] = +static const char *const re_error_msgid[] = { gettext_noop ("Success"), /* REG_NOERROR */ gettext_noop ("No match"), /* REG_NOMATCH */ @@ -1280,20 +1280,20 @@ static const char *gcc_exec_prefix; #define STANDARD_BINDIR_PREFIX "/usr/local/bin" #endif -static const char *standard_exec_prefix = STANDARD_EXEC_PREFIX; -static const char *standard_exec_prefix_1 = "/usr/lib/gcc/"; +static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX; +static const char *const standard_exec_prefix_1 = "/usr/lib/gcc/"; static const char *md_exec_prefix = MD_EXEC_PREFIX; static const char *md_startfile_prefix = MD_STARTFILE_PREFIX; static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1; -static const char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; -static const char *standard_startfile_prefix_1 = "/lib/"; -static const char *standard_startfile_prefix_2 = "/usr/lib/"; +static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX; +static const char *const standard_startfile_prefix_1 = "/lib/"; +static const char *const standard_startfile_prefix_2 = "/usr/lib/"; -static const char *tooldir_base_prefix = TOOLDIR_BASE_PREFIX; +static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX; static const char *tooldir_prefix; -static const char *standard_bindir_prefix = STANDARD_BINDIR_PREFIX; +static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX; /* Subdirectory to use for locating libraries. Set by set_multilib_dir based on the compilation options. */ @@ -2436,7 +2436,8 @@ find_a_file (pprefix, name, mode) int mode; { char *temp; - const char *file_suffix = ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : ""); + const char *const file_suffix = + ((mode & X_OK) != 0 ? HOST_EXECUTABLE_SUFFIX : ""); struct prefix_list *pl; int len = pprefix->max_len + strlen (name) + strlen (file_suffix) + 1; diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 3006ec8..071dd54 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -2445,7 +2445,7 @@ substitute_address (exp, no_address_fn, address_fn) static void make_length_attrs () { - static const char *new_names[] = {"*insn_default_length", + static const char *const new_names[] = {"*insn_default_length", "*insn_variable_length_p", "*insn_current_length"}; static rtx (*no_address_fn[]) PARAMS ((rtx)) = {identity_fn, zero_fn, zero_fn}; diff --git a/gcc/gencheck.c b/gcc/gencheck.c index 7eae8ec..b8fe254 100644 --- a/gcc/gencheck.c +++ b/gcc/gencheck.c @@ -23,7 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGX(SYM), -const char *tree_codes[] = { +static const char *const tree_codes[] = { #include "tree.def" #include "c-common.def" #include "gencheck.h" diff --git a/gcc/genemit.c b/gcc/genemit.c index 644fe38..f4ad66f 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -558,12 +558,10 @@ gen_split (split) { register int i; int operands; - const char *name = "split"; + const char *const name = + ((GET_CODE (split) == DEFINE_PEEPHOLE2) ? "peephole2" : "split"); const char *unused; - if (GET_CODE (split) == DEFINE_PEEPHOLE2) - name = "peephole2"; - if (XVEC (split, 0) == 0) fatal ("define_%s (definition %d) lacks a pattern", name, insn_index_number); diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 448f40a..c453b1a 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -216,7 +216,7 @@ static struct pred_table #define NUM_KNOWN_PREDS ARRAY_SIZE (preds) -static const char * special_mode_pred_table[] = { +static const char *const special_mode_pred_table[] = { #ifdef SPECIAL_MODE_PREDICATES SPECIAL_MODE_PREDICATES #endif diff --git a/gcc/graph.c b/gcc/graph.c index 462b6ab..355816e 100644 --- a/gcc/graph.c +++ b/gcc/graph.c @@ -31,7 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "graph.h" -static const char *graph_ext[] = +static const char *const graph_ext[] = { /* no_graph */ "", /* vcg */ ".vcg", diff --git a/gcc/protoize.c b/gcc/protoize.c index 98a0940..63b6935 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -205,8 +205,8 @@ static const int hash_mask = (HASH_TABLE_SIZE - 1); #define LOCAL_INCLUDE_DIR "/usr/local/include" #endif -struct default_include { const char *fname; - const char *component; +struct default_include { const char *const fname; + const char *const component; int x1, x2; } include_defaults[] #ifdef INCLUDE_DEFAULTS = INCLUDE_DEFAULTS; diff --git a/gcc/reload.c b/gcc/reload.c index ad4b4e8..99e4c6e 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -6743,7 +6743,7 @@ regno_clobbered_p (regno, insn, mode, sets) return 0; } -static const char *reload_when_needed_name[] = +static const char *const reload_when_needed_name[] = { "RELOAD_FOR_INPUT", "RELOAD_FOR_OUTPUT", diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c index 90521a2..95aa8af 100644 --- a/gcc/sched-vis.c +++ b/gcc/sched-vis.c @@ -905,7 +905,7 @@ void visualize_stall_cycles (stalls) int stalls; { - const char *prefix = ";; "; + const char *const prefix = ";; "; const char *suffix = "\n"; char *p; diff --git a/gcc/tlink.c b/gcc/tlink.c index d74e026..4a669b4 100644 --- a/gcc/tlink.c +++ b/gcc/tlink.c @@ -502,7 +502,7 @@ recompile_files () { char *line, *command; FILE *stream = fopen ((char*) f->root.key, "r"); - const char *outname = frob_extension ((char*) f->root.key, ".rnw"); + const char *const outname = frob_extension ((char*) f->root.key, ".rnw"); FILE *output = fopen (outname, "w"); while ((line = tfgets (stream)) != NULL) diff --git a/gcc/toplev.c b/gcc/toplev.c index 925f06b..d09dcca 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -4222,7 +4222,7 @@ decode_g_option (arg) -gdwarf -g3 is equivalent to -gdwarf3. */ static int type_explicitly_set_p = 0; /* Indexed by enum debug_info_type. */ - static const char *debug_type_names[] = + static const char *const debug_type_names[] = { "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff" }; diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c index 6984886..062d54e 100644 --- a/gcc/tradcpp.c +++ b/gcc/tradcpp.c @@ -1038,7 +1038,7 @@ output_deps () { /* Stream on which to print the dependency information. */ FILE *deps_stream = 0; - const char *deps_mode = deps_append ? "a" : "w"; + const char *const deps_mode = deps_append ? "a" : "w"; if (deps_file == 0) deps_stream = stdout; diff --git a/gcc/varasm.c b/gcc/varasm.c index defa0c6..b4d4d6d 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -747,7 +747,7 @@ decode_reg_name (asmspec) #ifdef ADDITIONAL_REGISTER_NAMES { - static struct { const char *name; int number; } table[] + static struct { const char *const name; int number; } table[] = ADDITIONAL_REGISTER_NAMES; for (i = 0; i < (int) ARRAY_SIZE (table); i++) |