From 0821bff7567934ec40bb8bee8a0d63b6cf8513bb Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 3 Aug 2001 15:42:25 +0000 Subject: [PATCH] mkdeps.c (deps_add_default_target): Make local variable ``start'' a const char pointer. * mkdeps.c (deps_add_default_target): Make local variable ``start'' a const char pointer. * dwarf2out.c (compute_section_prefix): Localize use of ``p''. From-SVN: r44600 --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 24 ++++++++++++++---------- gcc/mkdeps.c | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f73862ac6de..ddaca0d7fdc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-08-01 Andrew Cagney + + * mkdeps.c (deps_add_default_target): Make local variable + ``start'' a const char pointer. + * dwarf2out.c (compute_section_prefix): Localize use of ``p''. + 2001-08-03 Rainer Orth * doc/install.texi (Configuration): Fix markup. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0c34ab89f17..bf72954243f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -5397,7 +5397,7 @@ static void compute_section_prefix (unit_die) dw_die_ref unit_die; { - char *p, *name; + char *name; int i; unsigned char checksum[16]; struct md5_ctx ctx; @@ -5406,18 +5406,22 @@ compute_section_prefix (unit_die) die_checksum (unit_die, &ctx); md5_finish_ctx (&ctx, checksum); - p = lbasename (get_AT_string (unit_die, DW_AT_name)); - name = (char *) alloca (strlen (p) + 64); - sprintf (name, "%s.", p); + { + const char *p = lbasename (get_AT_string (unit_die, DW_AT_name)); + name = (char *) alloca (strlen (p) + 64); + sprintf (name, "%s.", p); + } clean_symbol_name (name); - p = name + strlen (name); - for (i = 0; i < 4; ++i) - { - sprintf (p, "%.2x", checksum[i]); - p += 2; - } + { + char *p = name + strlen (name); + for (i = 0; i < 4; ++i) + { + sprintf (p, "%.2x", checksum[i]); + p += 2; + } + } comdat_symbol_id = unit_die->die_symbol = xstrdup (name); comdat_symbol_number = 0; diff --git a/gcc/mkdeps.c b/gcc/mkdeps.c index 70c78f5d6a3..2c300631271 100644 --- a/gcc/mkdeps.c +++ b/gcc/mkdeps.c @@ -191,7 +191,7 @@ deps_add_default_target (d, tgt) #ifndef TARGET_OBJECT_SUFFIX # define TARGET_OBJECT_SUFFIX ".o" #endif - char *start = lbasename (tgt); + const char *start = lbasename (tgt); char *o = (char *) alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1); char *suffix;