diff options
-rw-r--r-- | gcc/ChangeLog | 35 | ||||
-rw-r--r-- | gcc/c-aux-info.c | 41 | ||||
-rw-r--r-- | gcc/c-common.c | 30 | ||||
-rw-r--r-- | gcc/cexp.c | 107 | ||||
-rw-r--r-- | gcc/cexp.y | 19 | ||||
-rw-r--r-- | gcc/gcse.c | 4 | ||||
-rw-r--r-- | gcc/integrate.c | 2 | ||||
-rw-r--r-- | gcc/optabs.c | 19 | ||||
-rw-r--r-- | gcc/real.c | 37 | ||||
-rw-r--r-- | gcc/real.h | 4 | ||||
-rw-r--r-- | gcc/sbitmap.c | 2 | ||||
-rw-r--r-- | gcc/sbitmap.h | 2 | ||||
-rw-r--r-- | gcc/stmt.c | 8 | ||||
-rw-r--r-- | gcc/toplev.c | 2 | ||||
-rw-r--r-- | gcc/tree.h | 4 |
15 files changed, 179 insertions, 137 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71781e2..28761f7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,38 @@ +Sat Mar 6 07:49:23 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * 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. + Fri Mar 5 23:16:42 1999 David Edelsohn <edelsohn@mhpcc.edu> * rs6000.h (ASM_OUTPUT_REG_{PUSH,POP}): Add 64-bit support and do diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c index d86d445..f4238dd 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)); diff --git a/gcc/c-common.c b/gcc/c-common.c index aa94b08..5def6421 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -60,8 +60,8 @@ enum attrs {A_PACKED, A_NOCOMMON, A_COMMON, A_NORETURN, A_CONST, A_T_UNION, enum format_type { printf_format_type, scanf_format_type, strftime_format_type }; -static void declare_hidden_char_array PROTO((char *, char *)); -static void add_attribute PROTO((enum attrs, char *, +static void declare_hidden_char_array PROTO((const char *, const char *)); +static void add_attribute PROTO((enum attrs, const char *, int, int, int)); static void init_attributes PROTO((void)); static void record_function_format PROTO((tree, tree, enum format_type, @@ -78,7 +78,7 @@ typedef struct { int compstmt_count; int line; - char *file; + const char *file; int needs_warning; } if_elt; static void tfaff PROTO((void)); @@ -170,7 +170,7 @@ c_expand_start_else () void declare_function_name () { - char *name, *printable_name; + const char *name, *printable_name; if (current_function_decl == NULL) { @@ -196,7 +196,7 @@ declare_function_name () static void declare_hidden_char_array (name, value) - char *name, *value; + const char *name, *value; { tree decl, type, init; int vlen; @@ -355,7 +355,7 @@ static int attrtab_idx = 0; static void add_attribute (id, string, min_len, max_len, decl_req) enum attrs id; - char *string; + const char *string; int min_len, max_len; int decl_req; { @@ -587,7 +587,7 @@ decl_attributes (node, attributes, prefix_attributes) else { int j; - char *p = IDENTIFIER_POINTER (TREE_VALUE (args)); + const char *p = IDENTIFIER_POINTER (TREE_VALUE (args)); int len = strlen (p); enum machine_mode mode = VOIDmode; tree typefm; @@ -719,7 +719,7 @@ decl_attributes (node, attributes, prefix_attributes) } else { - char *p = IDENTIFIER_POINTER (format_type_id); + const char *p = IDENTIFIER_POINTER (format_type_id); if (!strcmp (p, "printf") || !strcmp (p, "__printf__")) format_type = printf_format_type; @@ -1099,7 +1099,7 @@ strip_attrs (specs_attrs) #define T_ST &sizetype typedef struct { - char *format_chars; + const char *format_chars; int pointer_count; /* Type of argument if no length modifier is used. */ tree *nolen; @@ -1122,7 +1122,7 @@ typedef struct { If NULL, then this modifier is not allowed. */ tree *zlen; /* List of other modifier characters allowed with these options. */ - char *flag_chars; + const char *flag_chars; } format_char_info; static format_char_info print_char_table[] = { @@ -1376,7 +1376,7 @@ check_format_info (info, params) tree cur_type; tree wanted_type; tree first_fillin_param; - char *format_chars; + const char *format_chars; format_char_info *fci = NULL; char flag_chars[8]; int has_operand_number = 0; @@ -1540,7 +1540,7 @@ check_format_info (info, params) it is an operand number, so set PARAMS to that operand. */ if (*format_chars >= '0' && *format_chars <= '9') { - char *p = format_chars; + const char *p = format_chars; while (*p >= '0' && *p++ <= '9') ; @@ -1899,8 +1899,8 @@ check_format_info (info, params) && (TYPE_MAIN_VARIANT (cur_type) == signed_char_type_node || TYPE_MAIN_VARIANT (cur_type) == unsigned_char_type_node))) { - register char *this; - register char *that; + register const char *this; + register const char *that; this = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (wanted_type))); that = 0; @@ -2230,7 +2230,7 @@ void binary_op_error (code) enum tree_code code; { - register char *opname; + register const char *opname; switch (code) { @@ -46,7 +46,8 @@ struct arglist { HOST_WIDEST_INT parse_c_expression PROTO((char *, int)); static int yylex PROTO((void)); -static void yyerror PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +static void yyerror PVPROTO((const char *, ...)) + ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; static HOST_WIDEST_INT expression_value; #ifdef TEST_EXP_READER static int expression_signedp; @@ -131,9 +132,9 @@ struct constant; HOST_WIDEST_INT parse_escape PROTO((char **, HOST_WIDEST_INT)); int check_assertion PROTO((U_CHAR *, int, int, struct arglist *)); struct hashnode *lookup PROTO((U_CHAR *, int, int)); -void error PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; -void pedwarn PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; -void warning PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; +void error PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; +void pedwarn PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; +void warning PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; static int parse_number PROTO((int)); static HOST_WIDEST_INT left_shift PROTO((struct constant *, unsigned HOST_WIDEST_INT)); @@ -144,7 +145,7 @@ static void integer_overflow PROTO((void)); #define SIGNED (~0) #define UNSIGNED 0 -#line 152 "cexp.y" +#line 153 "cexp.y" typedef union { struct constant {HOST_WIDEST_INT value; int signedp;} integer; struct name {U_CHAR *address; int length;} name; @@ -225,10 +226,10 @@ static const short yyrhs[] = { 35, #if YYDEBUG != 0 static const short yyrline[] = { 0, - 182, 192, 193, 200, 205, 208, 210, 213, 217, 219, - 224, 229, 242, 259, 272, 278, 284, 290, 296, 299, - 302, 309, 316, 323, 330, 333, 336, 339, 342, 345, - 348, 351, 353, 356, 359, 361, 363, 371, 373, 386 + 183, 193, 194, 201, 206, 209, 211, 214, 218, 220, + 225, 230, 243, 260, 273, 279, 285, 291, 297, 300, + 303, 310, 317, 324, 331, 334, 337, 340, 343, 346, + 349, 352, 354, 357, 360, 362, 364, 372, 374, 387 }; #endif @@ -832,7 +833,7 @@ yyreduce: switch (yyn) { case 1: -#line 183 "cexp.y" +#line 184 "cexp.y" { expression_value = yyvsp[0].integer.value; #ifdef TEST_EXP_READER @@ -841,55 +842,55 @@ case 1: ; break;} case 3: -#line 194 "cexp.y" +#line 195 "cexp.y" { if (pedantic) pedwarn ("comma operator in operand of `#if'"); yyval.integer = yyvsp[0].integer; ; break;} case 4: -#line 201 "cexp.y" +#line 202 "cexp.y" { yyval.integer.value = - yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[0].integer.signedp; if ((yyval.integer.value & yyvsp[0].integer.value & yyval.integer.signedp) < 0) integer_overflow (); ; break;} case 5: -#line 206 "cexp.y" +#line 207 "cexp.y" { yyval.integer.value = ! yyvsp[0].integer.value; yyval.integer.signedp = SIGNED; ; break;} case 6: -#line 209 "cexp.y" +#line 210 "cexp.y" { yyval.integer = yyvsp[0].integer; ; break;} case 7: -#line 211 "cexp.y" +#line 212 "cexp.y" { yyval.integer.value = ~ yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[0].integer.signedp; ; break;} case 8: -#line 214 "cexp.y" +#line 215 "cexp.y" { yyval.integer.value = check_assertion (yyvsp[0].name.address, yyvsp[0].name.length, 0, NULL_PTR); yyval.integer.signedp = SIGNED; ; break;} case 9: -#line 218 "cexp.y" +#line 219 "cexp.y" { keyword_parsing = 1; ; break;} case 10: -#line 220 "cexp.y" +#line 221 "cexp.y" { yyval.integer.value = check_assertion (yyvsp[-4].name.address, yyvsp[-4].name.length, 1, yyvsp[-1].keywords); keyword_parsing = 0; yyval.integer.signedp = SIGNED; ; break;} case 11: -#line 225 "cexp.y" +#line 226 "cexp.y" { yyval.integer = yyvsp[-1].integer; ; break;} case 12: -#line 230 "cexp.y" +#line 231 "cexp.y" { yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; if (yyval.integer.signedp) { @@ -904,7 +905,7 @@ case 12: * yyvsp[0].integer.value); ; break;} case 13: -#line 243 "cexp.y" +#line 244 "cexp.y" { if (yyvsp[0].integer.value == 0) { if (!skip_evaluation) @@ -923,7 +924,7 @@ case 13: / yyvsp[0].integer.value); ; break;} case 14: -#line 260 "cexp.y" +#line 261 "cexp.y" { if (yyvsp[0].integer.value == 0) { if (!skip_evaluation) @@ -938,7 +939,7 @@ case 14: % yyvsp[0].integer.value); ; break;} case 15: -#line 273 "cexp.y" +#line 274 "cexp.y" { yyval.integer.value = yyvsp[-2].integer.value + yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; if (overflow_sum_sign (yyvsp[-2].integer.value, yyvsp[0].integer.value, @@ -946,7 +947,7 @@ case 15: integer_overflow (); ; break;} case 16: -#line 279 "cexp.y" +#line 280 "cexp.y" { yyval.integer.value = yyvsp[-2].integer.value - yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; if (overflow_sum_sign (yyval.integer.value, yyvsp[0].integer.value, @@ -954,7 +955,7 @@ case 16: integer_overflow (); ; break;} case 17: -#line 285 "cexp.y" +#line 286 "cexp.y" { yyval.integer.signedp = yyvsp[-2].integer.signedp; if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0) yyval.integer.value = right_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value); @@ -962,7 +963,7 @@ case 17: yyval.integer.value = left_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ; break;} case 18: -#line 291 "cexp.y" +#line 292 "cexp.y" { yyval.integer.signedp = yyvsp[-2].integer.signedp; if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0) yyval.integer.value = left_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value); @@ -970,17 +971,17 @@ case 18: yyval.integer.value = right_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ; break;} case 19: -#line 297 "cexp.y" +#line 298 "cexp.y" { yyval.integer.value = (yyvsp[-2].integer.value == yyvsp[0].integer.value); yyval.integer.signedp = SIGNED; ; break;} case 20: -#line 300 "cexp.y" +#line 301 "cexp.y" { yyval.integer.value = (yyvsp[-2].integer.value != yyvsp[0].integer.value); yyval.integer.signedp = SIGNED; ; break;} case 21: -#line 303 "cexp.y" +#line 304 "cexp.y" { yyval.integer.signedp = SIGNED; if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) yyval.integer.value = yyvsp[-2].integer.value <= yyvsp[0].integer.value; @@ -989,7 +990,7 @@ case 21: <= yyvsp[0].integer.value); ; break;} case 22: -#line 310 "cexp.y" +#line 311 "cexp.y" { yyval.integer.signedp = SIGNED; if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) yyval.integer.value = yyvsp[-2].integer.value >= yyvsp[0].integer.value; @@ -998,7 +999,7 @@ case 22: >= yyvsp[0].integer.value); ; break;} case 23: -#line 317 "cexp.y" +#line 318 "cexp.y" { yyval.integer.signedp = SIGNED; if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) yyval.integer.value = yyvsp[-2].integer.value < yyvsp[0].integer.value; @@ -1007,7 +1008,7 @@ case 23: < yyvsp[0].integer.value); ; break;} case 24: -#line 324 "cexp.y" +#line 325 "cexp.y" { yyval.integer.signedp = SIGNED; if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) yyval.integer.value = yyvsp[-2].integer.value > yyvsp[0].integer.value; @@ -1016,64 +1017,64 @@ case 24: > yyvsp[0].integer.value); ; break;} case 25: -#line 331 "cexp.y" +#line 332 "cexp.y" { yyval.integer.value = yyvsp[-2].integer.value & yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ; break;} case 26: -#line 334 "cexp.y" +#line 335 "cexp.y" { yyval.integer.value = yyvsp[-2].integer.value ^ yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ; break;} case 27: -#line 337 "cexp.y" +#line 338 "cexp.y" { yyval.integer.value = yyvsp[-2].integer.value | yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ; break;} case 28: -#line 340 "cexp.y" +#line 341 "cexp.y" { skip_evaluation += !yyvsp[-1].integer.value; ; break;} case 29: -#line 342 "cexp.y" +#line 343 "cexp.y" { skip_evaluation -= !yyvsp[-3].integer.value; yyval.integer.value = (yyvsp[-3].integer.value && yyvsp[0].integer.value); yyval.integer.signedp = SIGNED; ; break;} case 30: -#line 346 "cexp.y" +#line 347 "cexp.y" { skip_evaluation += !!yyvsp[-1].integer.value; ; break;} case 31: -#line 348 "cexp.y" +#line 349 "cexp.y" { skip_evaluation -= !!yyvsp[-3].integer.value; yyval.integer.value = (yyvsp[-3].integer.value || yyvsp[0].integer.value); yyval.integer.signedp = SIGNED; ; break;} case 32: -#line 352 "cexp.y" +#line 353 "cexp.y" { skip_evaluation += !yyvsp[-1].integer.value; ; break;} case 33: -#line 354 "cexp.y" +#line 355 "cexp.y" { skip_evaluation += !!yyvsp[-4].integer.value - !yyvsp[-4].integer.value; ; break;} case 34: -#line 356 "cexp.y" +#line 357 "cexp.y" { skip_evaluation -= !!yyvsp[-6].integer.value; yyval.integer.value = yyvsp[-6].integer.value ? yyvsp[-3].integer.value : yyvsp[0].integer.value; yyval.integer.signedp = yyvsp[-3].integer.signedp & yyvsp[0].integer.signedp; ; break;} case 35: -#line 360 "cexp.y" +#line 361 "cexp.y" { yyval.integer = yylval.integer; ; break;} case 36: -#line 362 "cexp.y" +#line 363 "cexp.y" { yyval.integer = yylval.integer; ; break;} case 37: -#line 364 "cexp.y" +#line 365 "cexp.y" { if (warn_undef && !skip_evaluation) warning ("`%.*s' is not defined", yyvsp[0].name.length, yyvsp[0].name.address); @@ -1081,11 +1082,11 @@ case 37: yyval.integer.signedp = SIGNED; ; break;} case 38: -#line 372 "cexp.y" +#line 373 "cexp.y" { yyval.keywords = 0; ; break;} case 39: -#line 374 "cexp.y" +#line 375 "cexp.y" { struct arglist *temp; yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist)); yyval.keywords->next = yyvsp[-2].keywords; @@ -1100,7 +1101,7 @@ case 39: temp->next->length = 1; ; break;} case 40: -#line 387 "cexp.y" +#line 388 "cexp.y" { yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist)); yyval.keywords->name = yyvsp[-1].name.address; yyval.keywords->length = yyvsp[-1].name.length; @@ -1304,7 +1305,7 @@ yyerrhandle: yystate = yyn; goto yynewstate; } -#line 392 "cexp.y" +#line 393 "cexp.y" /* During parsing of a C expression, the pointer to the next character @@ -1410,7 +1411,7 @@ parse_number (olen) } struct token { - char *operator; + const char *operator; int token; }; @@ -1917,17 +1918,17 @@ parse_c_expression (string, warn_undefined) } static void -yyerror VPROTO ((char * msgid, ...)) +yyerror VPROTO ((const char * msgid, ...)) { #ifndef ANSI_PROTOTYPES - char * msgid; + const char * msgid; #endif va_list args; VA_START (args, msgid); #ifndef ANSI_PROTOTYPES - msgid = va_arg (args, char *); + msgid = va_arg (args, const char *); #endif fprintf (stderr, "error: "); @@ -1,5 +1,5 @@ /* Parse C expressions for CCCP. - Copyright (C) 1987, 92, 94, 95, 96, 97, 1998 Free Software Foundation. + Copyright (C) 1987, 92, 94-98, 1999 Free Software Foundation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -50,7 +50,8 @@ struct arglist { HOST_WIDEST_INT parse_c_expression PROTO((char *, int)); static int yylex PROTO((void)); -static void yyerror PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +static void yyerror PVPROTO((const char *, ...)) + ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; static HOST_WIDEST_INT expression_value; #ifdef TEST_EXP_READER static int expression_signedp; @@ -135,9 +136,9 @@ struct constant; HOST_WIDEST_INT parse_escape PROTO((char **, HOST_WIDEST_INT)); int check_assertion PROTO((U_CHAR *, int, int, struct arglist *)); struct hashnode *lookup PROTO((U_CHAR *, int, int)); -void error PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; -void pedwarn PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; -void warning PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1; +void error PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; +void pedwarn PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; +void warning PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; static int parse_number PROTO((int)); static HOST_WIDEST_INT left_shift PROTO((struct constant *, unsigned HOST_WIDEST_INT)); @@ -494,7 +495,7 @@ parse_number (olen) } struct token { - char *operator; + const char *operator; int token; }; @@ -1001,17 +1002,17 @@ parse_c_expression (string, warn_undefined) } static void -yyerror VPROTO ((char * msgid, ...)) +yyerror VPROTO ((const char * msgid, ...)) { #ifndef ANSI_PROTOTYPES - char * msgid; + const char * msgid; #endif va_list args; VA_START (args, msgid); #ifndef ANSI_PROTOTYPES - msgid = va_arg (args, char *); + msgid = va_arg (args, const char *); #endif fprintf (stderr, "error: "); @@ -576,7 +576,7 @@ static void compute_set_hash_table PROTO ((rtx)); static void alloc_expr_hash_table PROTO ((int)); static void free_expr_hash_table PROTO ((void)); static void compute_expr_hash_table PROTO ((rtx)); -static void dump_hash_table PROTO ((FILE *, char *, struct expr **, int, int)); +static void dump_hash_table PROTO ((FILE *, const char *, struct expr **, int, int)); static struct expr *lookup_expr PROTO ((rtx)); static struct expr *lookup_set PROTO ((int, rtx)); static struct expr *next_set PROTO ((int, struct expr *)); @@ -1910,7 +1910,7 @@ hash_scan_insn (insn, set_p, in_libcall_block) static void dump_hash_table (file, name, table, table_size, total_size) FILE *file; - char *name; + const char *name; struct expr **table; int table_size, total_size; { diff --git a/gcc/integrate.c b/gcc/integrate.c index e9c3561..1bcc280 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -110,7 +110,7 @@ get_label_from_map (map, i) Nonzero means value is a warning msgid with a single %s for the function's name. */ -char * +const char * function_cannot_inline_p (fndecl) register tree fndecl; { diff --git a/gcc/optabs.c b/gcc/optabs.c index 1422793..0ec9066 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -21,13 +21,16 @@ Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" + +/* Include insn-config.h before expr.h so that HAVE_conditional_move + is properly defined. */ +#include "insn-config.h" #include "rtl.h" #include "tree.h" #include "flags.h" #include "insn-flags.h" #include "insn-codes.h" #include "expr.h" -#include "insn-config.h" #include "recog.h" #include "reload.h" @@ -248,9 +251,9 @@ static enum insn_code can_float_p PROTO((enum machine_mode, enum machine_mode, int)); static rtx ftruncify PROTO((rtx)); static optab init_optab PROTO((enum rtx_code)); -static void init_libfuncs PROTO((optab, int, int, char *, int)); -static void init_integral_libfuncs PROTO((optab, char *, int)); -static void init_floating_libfuncs PROTO((optab, char *, int)); +static void init_libfuncs PROTO((optab, int, int, const char *, int)); +static void init_integral_libfuncs PROTO((optab, const char *, int)); +static void init_floating_libfuncs PROTO((optab, const char *, int)); #ifdef HAVE_conditional_trap static void init_traps PROTO((void)); #endif @@ -4085,7 +4088,7 @@ init_libfuncs (optable, first_mode, last_mode, opname, suffix) register optab optable; register int first_mode; register int last_mode; - register char *opname; + register const char *opname; register int suffix; { register int mode; @@ -4099,7 +4102,7 @@ init_libfuncs (optable, first_mode, last_mode, opname, suffix) register char *libfunc_name = (char *) xmalloc (2 + opname_len + mname_len + 1 + 1); register char *p; - register char *q; + register const char *q; p = libfunc_name; *p++ = '_'; @@ -4123,7 +4126,7 @@ init_libfuncs (optable, first_mode, last_mode, opname, suffix) static void init_integral_libfuncs (optable, opname, suffix) register optab optable; - register char *opname; + register const char *opname; register int suffix; { init_libfuncs (optable, SImode, TImode, opname, suffix); @@ -4137,7 +4140,7 @@ init_integral_libfuncs (optable, opname, suffix) static void init_floating_libfuncs (optable, opname, suffix) register optab optable; - register char *opname; + register const char *opname; register int suffix; { init_libfuncs (optable, SFmode, TFmode, opname, suffix); @@ -414,12 +414,12 @@ static void e64toasc PROTO((unsigned EMUSHORT *, char *, int)); static void e113toasc PROTO((unsigned EMUSHORT *, char *, int)); #endif /* 0 */ static void etoasc PROTO((unsigned EMUSHORT *, char *, int)); -static void asctoe24 PROTO((char *, unsigned EMUSHORT *)); -static void asctoe53 PROTO((char *, unsigned EMUSHORT *)); -static void asctoe64 PROTO((char *, unsigned EMUSHORT *)); -static void asctoe113 PROTO((char *, unsigned EMUSHORT *)); -static void asctoe PROTO((char *, unsigned EMUSHORT *)); -static void asctoeg PROTO((char *, unsigned EMUSHORT *, int)); +static void asctoe24 PROTO((const char *, unsigned EMUSHORT *)); +static void asctoe53 PROTO((const char *, unsigned EMUSHORT *)); +static void asctoe64 PROTO((const char *, unsigned EMUSHORT *)); +static void asctoe113 PROTO((const char *, unsigned EMUSHORT *)); +static void asctoe PROTO((const char *, unsigned EMUSHORT *)); +static void asctoeg PROTO((const char *, unsigned EMUSHORT *, int)); static void efloor PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); #if 0 static void efrexp PROTO((unsigned EMUSHORT *, int *, @@ -431,7 +431,7 @@ static void eremain PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *, unsigned EMUSHORT *)); #endif static void eiremain PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); -static void mtherr PROTO((char *, int)); +static void mtherr PROTO((const char *, int)); #ifdef DEC static void dectoe PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); static void etodec PROTO((unsigned EMUSHORT *, unsigned EMUSHORT *)); @@ -691,7 +691,7 @@ etruncui (x) REAL_VALUE_TYPE ereal_atof (s, t) - char *s; + const char *s; enum machine_mode t; { unsigned EMUSHORT tem[NE], e[NE]; @@ -5006,7 +5006,7 @@ etoasc (x, string, ndigs) static void asctoe24 (s, y) - char *s; + const char *s; unsigned EMUSHORT *y; { asctoeg (s, y, 24); @@ -5017,7 +5017,7 @@ asctoe24 (s, y) static void asctoe53 (s, y) - char *s; + const char *s; unsigned EMUSHORT *y; { #if defined(DEC) || defined(IBM) @@ -5036,7 +5036,7 @@ asctoe53 (s, y) static void asctoe64 (s, y) - char *s; + const char *s; unsigned EMUSHORT *y; { asctoeg (s, y, 64); @@ -5046,7 +5046,7 @@ asctoe64 (s, y) static void asctoe113 (s, y) - char *s; + const char *s; unsigned EMUSHORT *y; { asctoeg (s, y, 113); @@ -5056,7 +5056,7 @@ asctoe113 (s, y) static void asctoe (s, y) - char *s; + const char *s; unsigned EMUSHORT *y; { asctoeg (s, y, NBITS); @@ -5067,7 +5067,7 @@ asctoe (s, y) static void asctoeg (ss, y, oprec) - char *ss; + const char *ss; unsigned EMUSHORT *y; int oprec; { @@ -5082,12 +5082,11 @@ asctoeg (ss, y, oprec) /* Copy the input string. */ lstr = (char *) alloca (strlen (ss) + 1); - s = ss; - while (*s == ' ') /* skip leading spaces */ - ++s; + while (*ss == ' ') /* skip leading spaces */ + ++ss; sp = lstr; - while ((*sp++ = *s++) != '\0') + while ((*sp++ = *ss++) != '\0') ; s = lstr; @@ -5664,7 +5663,7 @@ extern int merror; static void mtherr (name, code) - char *name; + const char *name; int code; { /* The string passed by the calling program is supposed to be the @@ -1,5 +1,5 @@ /* Definitions of floating-point access for GNU compiler. - Copyright (C) 1989, 91, 94, 96, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1989, 91, 94, 96-98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -132,7 +132,7 @@ extern void earith PROTO((REAL_VALUE_TYPE *, int, REAL_VALUE_TYPE *, REAL_VALUE_TYPE *)); extern REAL_VALUE_TYPE etrunci PROTO((REAL_VALUE_TYPE)); extern REAL_VALUE_TYPE etruncui PROTO((REAL_VALUE_TYPE)); -extern REAL_VALUE_TYPE ereal_atof PROTO((char *, enum machine_mode)); +extern REAL_VALUE_TYPE ereal_atof PROTO((const char *, enum machine_mode)); extern REAL_VALUE_TYPE ereal_negate PROTO((REAL_VALUE_TYPE)); extern HOST_WIDE_INT efixi PROTO((REAL_VALUE_TYPE)); extern unsigned HOST_WIDE_INT efixui PROTO((REAL_VALUE_TYPE)); diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 6513d07..2a41792 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -454,7 +454,7 @@ dump_sbitmap (file, bmap) void dump_sbitmap_vector (file, title, subtitle, bmaps, n_maps) FILE *file; - char *title, *subtitle; + const char *title, *subtitle; sbitmap *bmaps; int n_maps; { diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h index 350142d..ca475fa 100644 --- a/gcc/sbitmap.h +++ b/gcc/sbitmap.h @@ -90,7 +90,7 @@ do { \ #define sbitmap_vector_free(vec) free(vec) extern void dump_sbitmap PROTO ((FILE *, sbitmap)); -extern void dump_sbitmap_vector PROTO ((FILE *, char *, char *, +extern void dump_sbitmap_vector PROTO ((FILE *, const char *, const char *, sbitmap *, int)); extern sbitmap sbitmap_alloc PROTO ((int)); @@ -306,7 +306,7 @@ struct nesting /* Number of range exprs in case statement. */ int num_ranges; /* Name of this kind of statement, for warnings. */ - char *printname; + const char *printname; /* Used to save no_line_numbers till we see the first case label. We set this to -1 when we see the first case label in this case statement. */ @@ -425,7 +425,7 @@ struct label_chain static int using_eh_for_cleanups_p = 0; -static int n_occurrences PROTO((int, char *)); +static int n_occurrences PROTO((int, const char *)); static void expand_goto_internal PROTO((tree, rtx, rtx)); static int expand_fixup PROTO((tree, rtx, rtx)); static rtx expand_nl_handler_label PROTO((rtx, rtx)); @@ -1120,7 +1120,7 @@ fixup_gotos (thisblock, stack_level, cleanup_list, first_insn, dont_jump_in) static int n_occurrences (c, s) int c; - char *s; + const char *s; { int n = 0; while (*s) @@ -4172,7 +4172,7 @@ expand_start_case (exit_flag, expr, type, printname) int exit_flag; tree expr; tree type; - char *printname; + const char *printname; { register struct nesting *thiscase = ALLOC_NESTING (); diff --git a/gcc/toplev.c b/gcc/toplev.c index 6659848..c6dc50f 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -3497,7 +3497,7 @@ rest_of_compilation (decl) if (DECL_SAVED_INSNS (decl) == 0) { int inlinable = 0; - char *lose; + const char *lose; /* If requested, consider whether to make this function inline. */ if (DECL_INLINE (decl) || flag_inline_functions) @@ -1805,7 +1805,7 @@ extern tree decl_type_context PROTO((tree)); Otherwise return a warning message with a single %s for the function's name. */ -extern char *function_cannot_inline_p PROTO((tree)); +extern const char *function_cannot_inline_p PROTO((tree)); /* Return 1 if EXPR is the real constant zero. */ extern int real_zerop PROTO((tree)); @@ -1946,7 +1946,7 @@ extern tree last_cleanup_this_contour PROTO((void)); extern int expand_dhc_cleanup PROTO((tree)); extern int expand_dcc_cleanup PROTO((tree)); extern void expand_start_case PROTO((int, tree, tree, - char *)); + const char *)); extern void expand_end_case PROTO((tree)); extern int pushcase PROTO((tree, tree (*) (tree, tree), |