summaryrefslogtreecommitdiff
path: root/gcc/c-aux-info.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-06 05:34:26 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-06 05:34:26 +0000
commit3eee82c52e790c83edbe1be7b372f2f5d10c2810 (patch)
treec772c985a70004b9455673e66fda09916b427de1 /gcc/c-aux-info.c
parent3456754b2dfa529e761e5f991d81820d8a6482ed (diff)
downloadgcc-3eee82c52e790c83edbe1be7b372f2f5d10c2810.tar.gz
* c-aux-info.c (data_type, affix_data_type, gen_decl,
gen_formal_list_for_type, gen_formal_list_for_func_def, gen_type): Qualify a char* with the `const' keyword. * c-common.c (declare_hidden_char_array, add_attribute, if_elt, declare_function_name, decl_attributes, format_char_info, check_format_info, binary_op_error): Likewise. * cexp.y (yyerror, error, pedwarn, warning, token): Likewise. * gcse.c (dump_hash_table): Likewise. * integrate.c (function_cannot_inline_p): Likewise * optabs.c: Include insn-config.h earlier. (init_libfuncs, init_integral_libfuncs, init_floating_libfuncs): Qualify a char* with the `const' keyword. * real.c (asctoe24, asctoe53, asctoe64, asctoe113, asctoe, asctoeg, mtherr, ereal_atof): Likewise. * real.h (ereal_atof): Likewise. * sbitmap.c (dump_sbitmap_vector): Likewise. * sbitmap.h (dump_sbitmap_vector): Likewise. * stmt.c (nesting, n_occurrences, expand_start_case): Likewise. * toplev.c (rest_of_compilation): Likewise. * tree.h (function_cannot_inline_p, expand_start_case): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25614 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-aux-info.c')
-rw-r--r--gcc/c-aux-info.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c
index d86d44539fb..f4238dd29e3 100644
--- a/gcc/c-aux-info.c
+++ b/gcc/c-aux-info.c
@@ -1,7 +1,7 @@
/* Generate information regarding function declarations and definitions based
on information stored in GCC's tree structure. This code implements the
-aux-info option.
- Copyright (C) 1989, 91, 94, 95, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1989, 91, 94, 95, 97-98, 1999 Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@segfault.us.com).
This file is part of GNU CC.
@@ -35,14 +35,14 @@ enum formals_style_enum {
typedef enum formals_style_enum formals_style;
-static char *data_type;
+static const char *data_type;
-static char *affix_data_type PROTO((char *));
-static char *gen_formal_list_for_type PROTO((tree, formals_style));
+static char *affix_data_type PROTO((const char *));
+static const char *gen_formal_list_for_type PROTO((tree, formals_style));
static int deserves_ellipsis PROTO((tree));
-static char *gen_formal_list_for_func_def PROTO((tree, formals_style));
-static char *gen_type PROTO((char *, tree, formals_style));
-static char *gen_decl PROTO((tree, int, formals_style));
+static const char *gen_formal_list_for_func_def PROTO((tree, formals_style));
+static const char *gen_type PROTO((const char *, tree, formals_style));
+static const char *gen_decl PROTO((tree, int, formals_style));
/* Concatenate a sequence of strings, returning the result.
@@ -120,13 +120,16 @@ concat VPROTO((const char *first, ...))
that look as expected. */
static char *
-affix_data_type (type_or_decl)
- char *type_or_decl;
+affix_data_type (param)
+ const char *param;
{
+ char *type_or_decl = (char *) alloca (strlen (param) + 1);
char *p = type_or_decl;
char *qualifiers_then_data_type;
char saved;
+ strcpy (type_or_decl, param);
+
/* Skip as many leading const's or volatile's as there are. */
for (;;)
@@ -164,12 +167,12 @@ affix_data_type (type_or_decl)
we are currently aiming for is non-ansi, then we just return a pair
of empty parens here. */
-static char *
+static const char *
gen_formal_list_for_type (fntype, style)
tree fntype;
formals_style style;
{
- char *formal_list = "";
+ const char *formal_list = "";
tree formal_type;
if (style != ansi)
@@ -178,7 +181,7 @@ gen_formal_list_for_type (fntype, style)
formal_type = TYPE_ARG_TYPES (fntype);
while (formal_type && TREE_VALUE (formal_type) != void_type_node)
{
- char *this_type;
+ const char *this_type;
if (*formal_list)
formal_list = concat (formal_list, ", ", NULL_PTR);
@@ -284,18 +287,18 @@ deserves_ellipsis (fntype)
This routine returns a string which is the source form for the entire
function formal parameter list. */
-static char *
+static const char *
gen_formal_list_for_func_def (fndecl, style)
tree fndecl;
formals_style style;
{
- char *formal_list = "";
+ const char *formal_list = "";
tree formal_decl;
formal_decl = DECL_ARGUMENTS (fndecl);
while (formal_decl)
{
- char *this_formal;
+ const char *this_formal;
if (*formal_list && ((style == ansi) || (style == k_and_r_names)))
formal_list = concat (formal_list, ", ", NULL_PTR);
@@ -359,9 +362,9 @@ gen_formal_list_for_func_def (fndecl, style)
to do at this point is for the initial caller to prepend the "data_type"
string onto the returned "seed". */
-static char *
+static const char *
gen_type (ret_val, t, style)
- char *ret_val;
+ const char *ret_val;
tree t;
formals_style style;
{
@@ -533,13 +536,13 @@ gen_type (ret_val, t, style)
associated with a function definition. In this case, we can assume that
an attached list of DECL nodes for function formal arguments is present. */
-static char *
+static const char *
gen_decl (decl, is_func_definition, style)
tree decl;
int is_func_definition;
formals_style style;
{
- char *ret_val;
+ const char *ret_val;
if (DECL_NAME (decl))
ret_val = IDENTIFIER_POINTER (DECL_NAME (decl));