aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2007-08-10 17:53:58 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2007-08-10 17:53:58 +0000
commit68a57691dc5d712bff5c70691dd90c0c670022d0 (patch)
tree53bd7b9b59c9d1379b40355a4bdf1833b81d993b /gcc/gcc.c
parentdf54b9ab94b46279d2af4977d8bdd4187151a5a7 (diff)
downloadgcc-68a57691dc5d712bff5c70691dd90c0c670022d0.zip
gcc-68a57691dc5d712bff5c70691dd90c0c670022d0.tar.gz
gcc-68a57691dc5d712bff5c70691dd90c0c670022d0.tar.bz2
system.h (CONST_CAST): New.
* system.h (CONST_CAST): New. * c-decl.c (c_make_fname_decl): Use it. * c-lex.c (cb_ident, lex_string): Likewise. * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise. * gcc.c (set_spec, read_specs, for_each_path, execute, do_spec_1, give_switch, set_multilib_dir): Likewise. * gengtype-parse.c (string_seq, typedef_name): Likewise. * passes.c (execute_one_pass): Likewise. * prefix.c (update_path): Likewise. * pretty-print.c (pp_base_destroy_prefix): Likewise. * tree.c (build_string): Likewise. cp: * call.c (name_as_c_string): Use CONST_CAST. * decl.c (build_decl): Likewise. * parser.c (cp_parser_string_literal): Likewise. fortran: * gfortranspec.c (lang_specific_driver): Use CONST_CAST. * options.c (gfc_post_options): Likewise. * parse.c (parse_omp_structured_block): Likewise. * st.c (gfc_free_statement): Likewise. java: * jcf-parse.c (read_class, java_parse_file): Use CONST_CAST. * jcf.h (JCF_FINISH): Likewise. From-SVN: r127344
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index fc85e2b..02c365b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1881,7 +1881,7 @@ set_spec (const char *name, const char *spec)
/* Free the old spec. */
if (old_spec && sl->alloc_p)
- free ((void *) old_spec);
+ free (CONST_CAST(old_spec));
sl->alloc_p = 1;
}
@@ -2186,7 +2186,7 @@ read_specs (const char *filename, int main_p)
set_spec (p2, *(sl->ptr_spec));
if (sl->alloc_p)
- free ((void *) *(sl->ptr_spec));
+ free (CONST_CAST (*(sl->ptr_spec)));
*(sl->ptr_spec) = "";
sl->alloc_p = 0;
@@ -2536,18 +2536,18 @@ for_each_path (const struct path_prefix *paths,
Don't repeat any we have already seen. */
if (multi_dir)
{
- free ((char *) multi_dir);
+ free (CONST_CAST (multi_dir));
multi_dir = NULL;
- free ((char *) multi_suffix);
+ free (CONST_CAST (multi_suffix));
multi_suffix = machine_suffix;
- free ((char *) just_multi_suffix);
+ free (CONST_CAST (just_multi_suffix));
just_multi_suffix = just_machine_suffix;
}
else
skip_multi_dir = true;
if (multi_os_dir)
{
- free ((char *) multi_os_dir);
+ free (CONST_CAST (multi_os_dir));
multi_os_dir = NULL;
}
else
@@ -2556,12 +2556,12 @@ for_each_path (const struct path_prefix *paths,
if (multi_dir)
{
- free ((char *) multi_dir);
- free ((char *) multi_suffix);
- free ((char *) just_multi_suffix);
+ free (CONST_CAST (multi_dir));
+ free (CONST_CAST (multi_suffix));
+ free (CONST_CAST (just_multi_suffix));
}
if (multi_os_dir)
- free ((char *) multi_os_dir);
+ free (CONST_CAST (multi_os_dir));
if (ret != path)
free (path);
return ret;
@@ -2968,7 +2968,7 @@ execute (void)
errmsg = pex_run (pex,
((i + 1 == n_commands ? PEX_LAST : 0)
| (string == commands[i].prog ? PEX_SEARCH : 0)),
- string, (char * const *) commands[i].argv,
+ string, (char * const *) CONST_CAST (commands[i].argv),
NULL, NULL, &err);
if (errmsg != NULL)
{
@@ -2982,7 +2982,7 @@ execute (void)
}
if (string != commands[i].prog)
- free ((void *) string);
+ free (CONST_CAST (string));
}
execution_count++;
@@ -5023,7 +5023,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
for (i = 0, j = 0; i < max; i++)
if (outfiles[i])
{
- argv[j] = (char *) outfiles[i];
+ argv[j] = (char *) CONST_CAST (outfiles[i]);
j++;
}
argv[j] = NULL;
@@ -5979,13 +5979,13 @@ give_switch (int switchnum, int omit_first_word)
while (length-- && !IS_DIR_SEPARATOR (arg[length]))
if (arg[length] == '.')
{
- ((char *)arg)[length] = 0;
+ ((char *)CONST_CAST(arg))[length] = 0;
dot = 1;
break;
}
do_spec_1 (arg, 1, NULL);
if (dot)
- ((char *)arg)[length] = '.';
+ ((char *)CONST_CAST(arg))[length] = '.';
do_spec_1 (suffix_subst, 1, NULL);
}
else
@@ -7438,7 +7438,7 @@ set_multilib_dir (void)
if (multilib_dir == NULL && multilib_os_dir != NULL
&& strcmp (multilib_os_dir, ".") == 0)
{
- free ((char *) multilib_os_dir);
+ free (CONST_CAST (multilib_os_dir));
multilib_os_dir = NULL;
}
else if (multilib_dir != NULL && multilib_os_dir == NULL)