summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog54
-rw-r--r--gcc/cpplib.c32
-rw-r--r--gcc/cppulp.c4
-rw-r--r--gcc/dyn-string.c4
-rw-r--r--gcc/dyn-string.h4
-rw-r--r--gcc/final.c12
-rw-r--r--gcc/output.h16
-rw-r--r--gcc/profile.c4
-rw-r--r--gcc/rtl.h4
-rw-r--r--gcc/toplev.c313
-rw-r--r--gcc/toplev.h75
-rw-r--r--gcc/tree.h2
-rw-r--r--gcc/varasm.c14
13 files changed, 306 insertions, 232 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b5e702afe87..1ec2ec5cddd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,57 @@
+Mon Jan 18 11:48:28 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
+ Instead of writing to const char *buf directly, use a non-const
+ variable `wbuf' to allocate and write a string, then set buf = wbuf.
+
+ * cppulp.c (user_label_prefix): Qualify a char* with the `const'
+ keyword.
+
+ * dyn-string.c (dyn_string_append): Likewise.
+
+ * dyn-string.h (dyn_string_append): Likewise.
+
+ * final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
+
+ * output.h (end_final, output_operand_lossage, asm_fprintf,
+ named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
+ Likewise.
+
+ * profile.c (init_branch_prob): Likewise.
+
+ * toplev.c (set_target_switch, vmessage,
+ v_message_with_file_and_line, v_message_with_decl,
+ v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
+ verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
+ v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
+ v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
+ open_dump_file, dump_rtl, clean_dump_file,
+ print_version, print_single_switch, print_switch_values,
+ dump_base_name, debug_args, lang_independent_options,
+ user_label_prefix, documented_lang_options, target_switches,
+ target_options, print_time, pfatal_with_name, fatal_io_error,
+ fatal_insn, default_print_error_function, print_error_function,
+ report_error_function, error_with_file_and_line, error_with_decl,
+ error_for_asm, error, fatal, warning_with_file_and_line,
+ warning_with_decl, warning_for_asm, warning, pedwarn,
+ pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
+ really_sorry, botch, output_quoted_string, output_file_directive,
+ open_dump_file, rest_of_decl_compilation, display_help, main):
+ Likewise.
+
+ * toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
+ fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
+ warning_with_file_and_line, error_with_file_and_line, sorry,
+ really_sorry, default_print_error_function, report_error_function,
+ rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
+ error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
+ output_file_directive, botch): Likewise.
+
+ * tree.h (make_decl_rtl): Likewise.
+
+ * varasm.c (strip_reg_name, named_section, decode_reg_name,
+ make_decl_rtl): Likewise.
+
Mon Jan 18 11:35:49 1999 Gavin Romig-Koch <gavin@cygnus.com>
* Makefile.in (TCL_LIBRARY): Use 'cd' to find the library
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 1c0b6c50ff3..aa343f51d04 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -2054,7 +2054,8 @@ special_symbol (hp, pfile)
HASHNODE *hp;
cpp_reader *pfile;
{
- char *buf;
+ const char *buf;
+ char *wbuf;
int len;
int true_indepth;
cpp_buffer *ip = NULL;
@@ -2108,13 +2109,15 @@ special_symbol (hp, pfile)
if (ip->fname != NULL)
true_indepth++;
- buf = (char *) alloca (8); /* Eight bytes ought to be more than enough */
- sprintf (buf, "%d", true_indepth - 1);
+ wbuf = (char *) alloca (8); /* Eight bytes ought to be more than enough*/
+ sprintf (wbuf, "%d", true_indepth - 1);
+ buf = wbuf;
break;
case T_VERSION:
- buf = (char *) alloca (3 + strlen (version_string));
- sprintf (buf, "\"%s\"", version_string);
+ wbuf = (char *) alloca (3 + strlen (version_string));
+ sprintf (wbuf, "\"%s\"", version_string);
+ buf = wbuf;
break;
#ifndef NO_BUILTIN_SIZE_TYPE
@@ -2142,19 +2145,20 @@ special_symbol (hp, pfile)
break;
case T_CONST:
- buf = (char *) alloca (4 * sizeof (int));
- sprintf (buf, "%d", hp->value.ival);
+ wbuf = (char *) alloca (4 * sizeof (int));
+ sprintf (wbuf, "%d", hp->value.ival);
#ifdef STDC_0_IN_SYSTEM_HEADERS
if (ip->system_header_p
&& hp->length == 8 && bcmp (hp->name, "__STDC__", 8) == 0
&& ! cpp_lookup (pfile, (U_CHAR *) "__STRICT_ANSI__", -1, -1))
- strcpy (buf, "0");
+ strcpy (wbuf, "0");
#endif
#if 0
if (pcp_inside_if && pcp_outfile)
/* Output a precondition for this macro use */
fprintf (pcp_outfile, "#define %s %d\n", hp->name, hp->value.ival);
#endif
+ buf = wbuf;
break;
case T_SPECLINE:
@@ -2163,21 +2167,23 @@ special_symbol (hp, pfile)
long col = ip->colno;
adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col);
- buf = (char *) alloca (10);
- sprintf (buf, "%ld", line);
+ wbuf = (char *) alloca (10);
+ sprintf (wbuf, "%ld", line);
+ buf = wbuf;
}
break;
case T_DATE:
case T_TIME:
- buf = (char *) alloca (20);
+ wbuf = (char *) alloca (20);
timebuf = timestamp (pfile);
if (hp->type == T_DATE)
- sprintf (buf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
+ sprintf (wbuf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
timebuf->tm_mday, timebuf->tm_year + 1900);
else
- sprintf (buf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min,
+ sprintf (wbuf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min,
timebuf->tm_sec);
+ buf = wbuf;
break;
case T_SPEC_DEFINED:
diff --git a/gcc/cppulp.c b/gcc/cppulp.c
index eb6e7f6922f..7e7457c68c0 100644
--- a/gcc/cppulp.c
+++ b/gcc/cppulp.c
@@ -1,5 +1,5 @@
/* CPP Library.
- Copyright (C) 1986, 87, 89, 92-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1986, 87, 89, 92-98, 1999 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -23,4 +23,4 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "output.h"
-char *user_label_prefix = 0;
+const char *user_label_prefix = 0;
diff --git a/gcc/dyn-string.c b/gcc/dyn-string.c
index f00510f2863..c9edfcb076e 100644
--- a/gcc/dyn-string.c
+++ b/gcc/dyn-string.c
@@ -1,5 +1,5 @@
/* An abstract string datatype.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GNU CC.
@@ -62,7 +62,7 @@ dyn_string_delete (ds)
dyn_string_t
dyn_string_append (ds, s)
dyn_string_t ds;
- char *s;
+ const char *s;
{
int len = strlen (s);
dyn_string_resize (ds, ds->length + len + 1 /* '\0' */);
diff --git a/gcc/dyn-string.h b/gcc/dyn-string.h
index d6cd137e644..9f9330886ca 100644
--- a/gcc/dyn-string.h
+++ b/gcc/dyn-string.h
@@ -1,5 +1,5 @@
/* An abstract string datatype.
- Copyright (C) 1998 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999 Free Software Foundation, Inc.
Contributed by Mark Mitchell (mark@markmitchell.com).
This file is part of GNU CC.
@@ -28,5 +28,5 @@ typedef struct dyn_string
extern dyn_string_t dyn_string_new PROTO((int));
extern void dyn_string_delete PROTO((dyn_string_t));
-extern dyn_string_t dyn_string_append PROTO((dyn_string_t, char*));
+extern dyn_string_t dyn_string_append PROTO((dyn_string_t, const char*));
extern dyn_string_t dyn_string_resize PROTO((dyn_string_t, int));
diff --git a/gcc/final.c b/gcc/final.c
index 461f605f0b6..6026d319c25 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1,5 +1,5 @@
/* Convert RTL to assembler code and output it, for GNU compiler.
- Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -335,7 +335,7 @@ init_final (filename)
void
end_final (filename)
- char *filename;
+ const char *filename;
{
int i;
@@ -3300,7 +3300,7 @@ alter_cond (cond)
void
output_operand_lossage (str)
- char *str;
+ const char *str;
{
if (this_is_asm_operands)
error_for_asm (this_is_asm_operands, "invalid `asm': %s", str);
@@ -3680,11 +3680,11 @@ output_addr_const (file, x)
We handle alternate assembler dialects here, just like output_asm_insn. */
void
-asm_fprintf VPROTO((FILE *file, char *p, ...))
+asm_fprintf VPROTO((FILE *file, const char *p, ...))
{
#ifndef ANSI_PROTOTYPES
FILE *file;
- char *p;
+ const char *p;
#endif
va_list argptr;
char buf[10];
@@ -3694,7 +3694,7 @@ asm_fprintf VPROTO((FILE *file, char *p, ...))
#ifndef ANSI_PROTOTYPES
file = va_arg (argptr, FILE *);
- p = va_arg (argptr, char *);
+ p = va_arg (argptr, const char *);
#endif
buf[0] = '%';
diff --git a/gcc/output.h b/gcc/output.h
index 376f2d95870..d677c012e05 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -1,6 +1,6 @@
/* Declarations for insn-output.c. These functions are defined in recog.c,
final.c, and varasm.c.
- Copyright (C) 1987, 1991, 1994, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991, 1994, 97-98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -24,7 +24,7 @@ extern void init_final PROTO((char *));
/* Called at end of source file,
to output the block-profiling table for this entire compilation. */
-extern void end_final PROTO((char *));
+extern void end_final PROTO((const char *));
/* Enable APP processing of subsequent output.
Used before the output from an `asm' statement. */
@@ -77,7 +77,7 @@ extern rtx alter_subreg PROTO((rtx));
/* Report inconsistency between the assembler template and the operands.
In an `asm', it's the user's fault; otherwise, the compiler's fault. */
-extern void output_operand_lossage PROTO((char *));
+extern void output_operand_lossage PROTO((const char *));
/* Output a string of assembler code, substituting insn operands.
Defined in final.c. */
@@ -106,7 +106,7 @@ extern void output_addr_const PROTO((FILE *, rtx));
/* Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes. */
-extern void asm_fprintf PROTO(PVPROTO((FILE *file, char *p, ...)));
+extern void asm_fprintf PVPROTO((FILE *file, const char *p, ...));
/* Split up a CONST_DOUBLE or integer constant rtx into two rtx's for single
words. */
@@ -161,7 +161,7 @@ extern void eh_frame_section PROTO ((void));
If DECL is NULL, just switch to section NAME.
If NAME is NULL, get the name from DECL.
If RELOC is 1, the initializer for DECL contains relocs. */
-extern void named_section PROTO((tree, char *, int));
+extern void named_section PROTO((tree, const char *, int));
/* Tell assembler to switch to the section for function DECL. */
extern void function_section PROTO((tree));
@@ -188,7 +188,7 @@ extern void weak_finish PROTO ((void));
or -4 if ASMSPEC is `memory' and is not recognized.
Accept an exact spelling or a decimal number.
Prefixes such as % are optional. */
-extern int decode_reg_name PROTO((char *));
+extern int decode_reg_name PROTO((const char *));
#ifdef TREE_CODE
/* Create the DECL_RTL for a declaration for a static or external variable
@@ -198,7 +198,7 @@ extern int decode_reg_name PROTO((char *));
TOP_LEVEL is nonzero if this is a file-scope variable.
This is never called for PARM_DECL nodes. */
-extern void make_decl_rtl PROTO((tree, char *, int));
+extern void make_decl_rtl PROTO((tree, const char *, int));
/* Make the rtl for variable VAR be volatile.
Use this only for static variables. */
@@ -487,4 +487,4 @@ extern FILE *rtl_dump_file;
&& ! (RELOC && (flag_pic || DECL_ONE_ONLY (DECL))))
/* User label prefix in effect for this compilation. */
-extern char *user_label_prefix;
+extern const char *user_label_prefix;
diff --git a/gcc/profile.c b/gcc/profile.c
index 12221eb9e9a..4809d7fbe54 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -1,5 +1,5 @@
/* Calculate branch probabilities, and basic block execution counts.
- Copyright (C) 1990, 91-94, 96, 97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91-94, 96-98, 1999 Free Software Foundation, Inc.
Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
based on some ideas from Dain Samples of UC Berkeley.
Further mangling by Bob Manson, Cygnus Support.
@@ -1407,7 +1407,7 @@ expand_spanning_tree (block)
void
init_branch_prob (filename)
- char *filename;
+ const char *filename;
{
long len;
int i;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 62c42c2ab66..f50c37248f9 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1,5 +1,5 @@
/* Register Transfer Language (RTL) definitions for GNU C-Compiler
- Copyright (C) 1987, 91-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91-98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -1467,7 +1467,7 @@ extern int reload PROTO ((rtx, int, FILE *));
extern void init_caller_save PROTO ((void));
/* In profile.c */
-extern void init_branch_prob PROTO ((char *));
+extern void init_branch_prob PROTO ((const char *));
#ifdef BUFSIZ
extern void branch_prob PROTO ((rtx, FILE *));
extern void end_branch_prob PROTO ((FILE *));
diff --git a/gcc/toplev.c b/gcc/toplev.c
index a58e16effda..8df7be5ef98 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1,5 +1,5 @@
/* Top level of GNU C compiler
- Copyright (C) 1987, 88, 89, 92-8, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-98, 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -162,56 +162,51 @@ extern void print_rtl ();
extern void print_rtl_with_bb ();
void rest_of_decl_compilation ();
-void error_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
-void error_with_decl PVPROTO((tree decl, char *s, ...));
-void error PVPROTO((char *s, ...));
-void fatal PVPROTO((char *s, ...));
-void warning_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
-void warning_with_decl PVPROTO((tree decl, char *s, ...));
-void warning PVPROTO((char *s, ...));
-void pedwarn PVPROTO((char *s, ...));
-void pedwarn_with_decl PVPROTO((tree decl, char *s, ...));
-void pedwarn_with_file_and_line PVPROTO((char *file, int line, char *s, ...));
-void sorry PVPROTO((char *s, ...));
-static void set_target_switch PROTO((char *));
+static void set_target_switch PROTO((const char *));
static char *decl_name PROTO((tree, int));
-static void vmessage PROTO((char *, char *, va_list));
-static void v_message_with_file_and_line PROTO((char *, int, char *,
- char *, va_list));
-static void v_message_with_decl PROTO((tree, char *, char *, va_list));
+static void vmessage PROTO((const char *, const char *, va_list));
+static void v_message_with_file_and_line PROTO((const char *, int,
+ const char *, const char *,
+ va_list));
+static void v_message_with_decl PROTO((tree, const char *,
+ const char *, va_list));
static void file_and_line_for_asm PROTO((rtx, char **, int *));
-static void v_error_with_file_and_line PROTO((char *, int, char *, va_list));
-static void v_error_with_decl PROTO((tree, char *, va_list));
-static void v_error_for_asm PROTO((rtx, char *, va_list));
-static void verror PROTO((char *, va_list));
-static void vfatal PROTO((char *, va_list)) ATTRIBUTE_NORETURN;
-static void v_warning_with_file_and_line PROTO ((char *, int, char *, va_list));
-static void v_warning_with_decl PROTO((tree, char *, va_list));
-static void v_warning_for_asm PROTO((rtx, char *, va_list));
-static void vwarning PROTO((char *, va_list));
-static void vpedwarn PROTO((char *, va_list));
-static void v_pedwarn_with_decl PROTO((tree, char *, va_list));
-static void v_pedwarn_with_file_and_line PROTO((char *, int, char *, va_list));
-static void vsorry PROTO((char *, va_list));
-static void v_really_sorry PROTO((char *, va_list)) ATTRIBUTE_NORETURN;
+static void v_error_with_file_and_line PROTO((const char *, int,
+ const char *, va_list));
+static void v_error_with_decl PROTO((tree, const char *, va_list));
+static void v_error_for_asm PROTO((rtx, const char *, va_list));
+static void verror PROTO((const char *, va_list));
+static void vfatal PROTO((const char *, va_list)) ATTRIBUTE_NORETURN;
+static void v_warning_with_file_and_line PROTO ((const char *, int,
+ const char *, va_list));
+static void v_warning_with_decl PROTO((tree, const char *, va_list));
+static void v_warning_for_asm PROTO((rtx, const char *, va_list));
+static void vwarning PROTO((const char *, va_list));
+static void vpedwarn PROTO((const char *, va_list));
+static void v_pedwarn_with_decl PROTO((tree, const char *, va_list));
+static void v_pedwarn_with_file_and_line PROTO((const char *, int,
+ const char *, va_list));
+static void vsorry PROTO((const char *, va_list));
+static void v_really_sorry PROTO((const char *, va_list)) ATTRIBUTE_NORETURN;
static void float_signal PROTO((int)) ATTRIBUTE_NORETURN;
static void pipe_closed PROTO((int)) ATTRIBUTE_NORETURN;
#ifdef ASM_IDENTIFY_LANGUAGE
/* This might or might not be used in ASM_IDENTIFY_LANGUAGE. */
static void output_lang_identify PROTO((FILE *)) ATTRIBUTE_UNUSED;
#endif
-static void open_dump_file PROTO((char *, char *));
+static void open_dump_file PROTO((const char *, const char *));
static void close_dump_file PROTO((void (*) (FILE *, rtx), rtx));
-static void dump_rtl PROTO((char *, tree, void (*) (FILE *, rtx), rtx));
-static void clean_dump_file PROTO((char *));
+static void dump_rtl PROTO((const char *, tree, void (*) (FILE *, rtx), rtx));
+static void clean_dump_file PROTO((const char *));
static void compile_file PROTO((char *));
static void display_help PROTO ((void));
-static void print_version PROTO((FILE *, char *));
-static int print_single_switch PROTO((FILE *, int, int, char *, char *, char *,
- char *, char *));
-static void print_switch_values PROTO((FILE *, int, int, char *, char *,
- char *));
+static void print_version PROTO((FILE *, const char *));
+static int print_single_switch PROTO((FILE *, int, int, const char *,
+ const char *, const char *,
+ const char *, const char *));
+static void print_switch_values PROTO((FILE *, int, int, const char *,
+ const char *, const char *));
void print_rtl_graph_with_bb PROTO ((const char *, const char *, rtx));
void clean_graph_dump_file PROTO ((const char *, const char *));
@@ -258,7 +253,7 @@ extern tree current_function_decl;
/* Name to use as base of names for dump output files. */
-char *dump_base_name;
+const char *dump_base_name;
/* Bit flags that specify the machine subtype we are compiling for.
Bits are tested using macros TARGET_... defined in the tm.h file
@@ -737,12 +732,12 @@ int flag_instrument_function_entry_exit = 0;
/* Table of supported debugging formats. */
static struct
{
- char * arg;
+ const char * arg;
/* Since PREFERRED_DEBUGGING_TYPE isn't necessarily a
constant expression, we use NO_DEBUG in its place. */
enum debug_info_type debug_type;
int use_extensions_p;
- char * description;
+ const char * description;
} *da,
debug_args[] =
{
@@ -773,10 +768,10 @@ debug_args[] =
typedef struct
{
- char * string;
+ const char * string;
int * variable;
int on_value;
- char * description;
+ const char * description;
}
lang_independent_options;
@@ -784,7 +779,7 @@ lang_independent_options;
int flag_leading_underscore = -1;
/* The user symbol prefix after having resolved same. */
-char *user_label_prefix;
+const char *user_label_prefix;
/* A default for same. */
#ifndef USER_LABEL_PREFIX
@@ -946,8 +941,8 @@ lang_independent_options f_options[] =
static struct lang_opt
{
- char * option;
- char * description;
+ const char * option;
+ const char * description;
}
documented_lang_options[] =
{
@@ -1115,9 +1110,9 @@ documented_lang_options[] =
struct
{
- char * name;
+ const char * name;
int value;
- char * description;
+ const char * description;
}
target_switches [] = TARGET_SWITCHES;
@@ -1126,9 +1121,9 @@ target_switches [] = TARGET_SWITCHES;
#ifdef TARGET_OPTIONS
struct
{
- char * prefix;
- char ** variable;
- char * description;
+ const char * prefix;
+ const char ** variable;
+ const char * description;
}
target_options [] = TARGET_OPTIONS;
#endif
@@ -1323,7 +1318,7 @@ do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while
void
print_time (str, total)
- char *str;
+ const char *str;
int total;
{
fprintf (stderr,
@@ -1362,7 +1357,7 @@ count_error (warningp)
void
pfatal_with_name (name)
- char *name;
+ const char *name;
{
fprintf (stderr, "%s: ", progname);
perror (name);
@@ -1371,7 +1366,7 @@ pfatal_with_name (name)
void
fatal_io_error (name)
- char *name;
+ const char *name;
{
fprintf (stderr, "%s: %s: I/O error\n", progname, name);
exit (FATAL_EXIT_CODE);
@@ -1382,7 +1377,7 @@ fatal_io_error (name)
void
fatal_insn (message, insn)
- char *message;
+ const char *message;
rtx insn;
{
error (message);
@@ -1456,11 +1451,11 @@ announce_function (decl)
void
default_print_error_function (file)
- char *file;
+ const char *file;
{
if (last_error_function != current_function_decl)
{
- char *kind = "function";
+ const char *kind = "function";
if (current_function_decl != 0
&& TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
kind = "method";
@@ -1483,14 +1478,15 @@ default_print_error_function (file)
/* Called by report_error_function to print out function name.
* Default may be overridden by language front-ends. */
-void (*print_error_function) PROTO((char *)) = default_print_error_function;
+void (*print_error_function) PROTO((const char *)) =
+ default_print_error_function;
/* Prints out, if necessary, the name of the current function
that caused an error. Called from all error and warning functions. */
void
report_error_function (file)
- char *file;
+ const char *file;
{
struct file_stack *p;
@@ -1522,8 +1518,8 @@ report_error_function (file)
static void
vmessage (prefix, s, ap)
- char *prefix;
- char *s;
+ const char *prefix;
+ const char *s;
va_list ap;
{
if (prefix)
@@ -1536,10 +1532,10 @@ vmessage (prefix, s, ap)
static void
v_message_with_file_and_line (file, line, prefix, s, ap)
- char *file;
+ const char *file;
int line;
- char *prefix;
- char *s;
+ const char *prefix;
+ const char *s;
va_list ap;
{
if (file)
@@ -1556,11 +1552,11 @@ v_message_with_file_and_line (file, line, prefix, s, ap)
static void
v_message_with_decl (decl, prefix, s, ap)
tree decl;
- char *prefix;
- char *s;
+ const char *prefix;
+ const char *s;
va_list ap;
{
- char *p;
+ const char *p;
fprintf (stderr, "%s:%d: ",
DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
@@ -1595,7 +1591,7 @@ v_message_with_decl (decl, prefix, s, ap)
if (*p == '%') /* Print the name. */
{
- char *n = (DECL_NAME (decl)
+ const char *n = (DECL_NAME (decl)
? (*decl_printable_name) (decl, 2)
: "((anonymous))");
fputs (n, stderr);
@@ -1654,9 +1650,9 @@ file_and_line_for_asm (insn, pfile, pline)
static void
v_error_with_file_and_line (file, line, s, ap)
- char *file;
+ const char *file;
int line;
- char *s;
+ const char *s;
va_list ap;
{
count_error (0);
@@ -1665,21 +1661,22 @@ v_error_with_file_and_line (file, line, s, ap)
}
void
-error_with_file_and_line VPROTO((char *file, int line, char *s, ...))
+error_with_file_and_line VPROTO((const char *file, int line,
+ const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *file;
+ const char *file;
int line;
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- file = va_arg (ap, char *);
+ file = va_arg (ap, const char *);
line = va_arg (ap, int);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_error_with_file_and_line (file, line, s, ap);
@@ -1693,7 +1690,7 @@ error_with_file_and_line VPROTO((char *file, int line, char *s, ...))
static void
v_error_with_decl (decl, s, ap)
tree decl;
- char *s;
+ const char *s;
va_list ap;
{
count_error (0);
@@ -1702,11 +1699,11 @@ v_error_with_decl (decl, s, ap)
}
void
-error_with_decl VPROTO((tree decl, char *s, ...))
+error_with_decl VPROTO((tree decl, const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
tree decl;
- char *s;
+ const char *s;
#endif
va_list ap;
@@ -1714,7 +1711,7 @@ error_with_decl VPROTO((tree decl, char *s, ...))
#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_error_with_decl (decl, s, ap);
@@ -1728,7 +1725,7 @@ error_with_decl VPROTO((tree decl, char *s, ...))
static void
v_error_for_asm (insn, s, ap)
rtx insn;
- char *s;
+ const char *s;
va_list ap;
{
char *file;
@@ -1741,11 +1738,11 @@ v_error_for_asm (insn, s, ap)
}
void
-error_for_asm VPROTO((rtx insn, char *s, ...))
+error_for_asm VPROTO((rtx insn, const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
rtx insn;
- char *s;
+ const char *s;
#endif
va_list ap;
@@ -1753,7 +1750,7 @@ error_for_asm VPROTO((rtx insn, char *s, ...))
#ifndef ANSI_PROTOTYPES
insn = va_arg (ap, rtx);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_error_for_asm (insn, s, ap);
@@ -1764,24 +1761,24 @@ error_for_asm VPROTO((rtx insn, char *s, ...))
static void
verror (s, ap)
- char *s;
+ const char *s;
va_list ap;
{
v_error_with_file_and_line (input_filename, lineno, s, ap);
}
void
-error VPROTO((char *s, ...))
+error VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
verror (s, ap);
@@ -1792,7 +1789,7 @@ error VPROTO((char *s, ...))
static void
vfatal (s, ap)
- char *s;
+ const char *s;
va_list ap;
{
verror (s, ap);
@@ -1800,17 +1797,17 @@ vfatal (s, ap)
}
void
-fatal VPROTO((char *s, ...))
+fatal VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
vfatal (s, ap);
@@ -1821,9 +1818,9 @@ fatal VPROTO((char *s, ...))
static void
v_warning_with_file_and_line (file, line, s, ap)
- char *file;
+ const char *file;
int line;
- char *s;
+ const char *s;
va_list ap;
{
if (count_error (1))
@@ -1834,21 +1831,22 @@ v_warning_with_file_and_line (file, line, s, ap)
}
void
-warning_with_file_and_line VPROTO((char *file, int line, char *s, ...))
+warning_with_file_and_line VPROTO((const char *file, int line,
+ const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *file;
+ const char *file;
int line;
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- file = va_arg (ap, char *);
+ file = va_arg (ap, const char *);
line = va_arg (ap, int);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_warning_with_file_and_line (file, line, s, ap);
@@ -1862,7 +1860,7 @@ warning_with_file_and_line VPROTO((char *file, int line, char *s, ...))
static void
v_warning_with_decl (decl, s, ap)
tree decl;
- char *s;
+ const char *s;
va_list ap;
{
if (count_error (1))
@@ -1873,11 +1871,11 @@ v_warning_with_decl (decl, s, ap)
}
void
-warning_with_decl VPROTO((tree decl, char *s, ...))
+warning_with_decl VPROTO((tree decl, const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
tree decl;
- char *s;
+ const char *s;
#endif
va_list ap;
@@ -1885,7 +1883,7 @@ warning_with_decl VPROTO((tree decl, char *s, ...))
#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_warning_with_decl (decl, s, ap);
@@ -1899,7 +1897,7 @@ warning_with_decl VPROTO((tree decl, char *s, ...))
static void
v_warning_for_asm (insn, s, ap)
rtx insn;
- char *s;
+ const char *s;
va_list ap;
{
if (count_error (1))
@@ -1914,11 +1912,11 @@ v_warning_for_asm (insn, s, ap)
}
void
-warning_for_asm VPROTO((rtx insn, char *s, ...))
+warning_for_asm VPROTO((rtx insn, const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
rtx insn;
- char *s;
+ const char *s;
#endif
va_list ap;
@@ -1926,7 +1924,7 @@ warning_for_asm VPROTO((rtx insn, char *s, ...))
#ifndef ANSI_PROTOTYPES
insn = va_arg (ap, rtx);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_warning_for_asm (insn, s, ap);
@@ -1937,24 +1935,24 @@ warning_for_asm VPROTO((rtx insn, char *s, ...))
static void
vwarning (s, ap)
- char *s;
+ const char *s;
va_list ap;
{
v_warning_with_file_and_line (input_filename, lineno, s, ap);
}
void
-warning VPROTO((char *s, ...))
+warning VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
vwarning (s, ap);
@@ -1966,7 +1964,7 @@ warning VPROTO((char *s, ...))
static void
vpedwarn (s, ap)
- char *s;
+ const char *s;
va_list ap;
{
if (flag_pedantic_errors)
@@ -1976,17 +1974,17 @@ vpedwarn (s, ap)
}
void
-pedwarn VPROTO((char *s, ...))
+pedwarn VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
vpedwarn (s, ap);
@@ -1996,7 +1994,7 @@ pedwarn VPROTO((char *s, ...))
static void
v_pedwarn_with_decl (decl, s, ap)
tree decl;
- char *s;
+ const char *s;
va_list ap;
{
/* We don't want -pedantic-errors to cause the compilation to fail from
@@ -2016,11 +2014,11 @@ v_pedwarn_with_decl (decl, s, ap)
}
void
-pedwarn_with_decl VPROTO((tree decl, char *s, ...))
+pedwarn_with_decl VPROTO((tree decl, const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
tree decl;
- char *s;
+ const char *s;
#endif
va_list ap;
@@ -2028,7 +2026,7 @@ pedwarn_with_decl VPROTO((tree decl, char *s, ...))
#ifndef ANSI_PROTOTYPES
decl = va_arg (ap, tree);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_pedwarn_with_decl (decl, s, ap);
@@ -2037,9 +2035,9 @@ pedwarn_with_decl VPROTO((tree decl, char *s, ...))
static void
v_pedwarn_with_file_and_line (file, line, s, ap)
- char *file;
+ const char *file;
int line;
- char *s;
+ const char *s;
va_list ap;
{
if (flag_pedantic_errors)
@@ -2049,21 +2047,22 @@ v_pedwarn_with_file_and_line (file, line, s, ap)
}
void
-pedwarn_with_file_and_line VPROTO((char *file, int line, char *s, ...))
+pedwarn_with_file_and_line VPROTO((const char *file, int line,
+ const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *file;
+ const char *file;
int line;
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- file = va_arg (ap, char *);
+ file = va_arg (ap, const char *);
line = va_arg (ap, int);
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_pedwarn_with_file_and_line (file, line, s, ap);
@@ -2074,7 +2073,7 @@ pedwarn_with_file_and_line VPROTO((char *file, int line, char *s, ...))
static void
vsorry (s, ap)
- char *s;
+ const char *s;
va_list ap;
{
sorrycount++;
@@ -2087,17 +2086,17 @@ vsorry (s, ap)
}
void
-sorry VPROTO((char *s, ...))
+sorry VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
vsorry (s, ap);
@@ -2108,7 +2107,7 @@ sorry VPROTO((char *s, ...))
static void
v_really_sorry (s, ap)
- char *s;
+ const char *s;
va_list ap;
{
sorrycount++;
@@ -2121,17 +2120,17 @@ v_really_sorry (s, ap)
}
void
-really_sorry VPROTO((char *s, ...))
+really_sorry VPROTO((const char *s, ...))
{
#ifndef ANSI_PROTOTYPES
- char *s;
+ const char *s;
#endif
va_list ap;
VA_START (ap, s);
#ifndef ANSI_PROTOTYPES
- s = va_arg (ap, char *);
+ s = va_arg (ap, const char *);
#endif
v_really_sorry (s, ap);
@@ -2166,7 +2165,7 @@ do_abort ()
void
botch (s)
- char * s ATTRIBUTE_UNUSED;
+ const char * s ATTRIBUTE_UNUSED;
{
abort ();
}
@@ -2382,7 +2381,7 @@ strip_off_ending (name, len)
void
output_quoted_string (asm_file, string)
FILE *asm_file;
- char *string;
+ const char *string;
{
#ifdef OUTPUT_QUOTED_STRING
OUTPUT_QUOTED_STRING (asm_file, string);
@@ -2405,10 +2404,10 @@ output_quoted_string (asm_file, string)
void
output_file_directive (asm_file, input_name)
FILE *asm_file;
- char *input_name;
+ const char *input_name;
{
int len = strlen (input_name);
- char *na = input_name + len;
+ const char *na = input_name + len;
/* NA gets INPUT_NAME sans directory names. */
while (na > input_name)
@@ -2451,8 +2450,8 @@ output_lang_identify (asm_out_file)
/* Routine to open a dump file. */
static void
open_dump_file (suffix, function_name)
- char *suffix;
- char *function_name;
+ const char *suffix;
+ const char *function_name;
{
char *dumpname;
@@ -2505,7 +2504,7 @@ close_dump_file (func, insns)
/* Routine to dump rtl into a file. */
static void
dump_rtl (suffix, decl, func, insns)
- char *suffix;
+ const char *suffix;
tree decl;
void (*func) PROTO ((FILE *, rtx));
rtx insns;
@@ -2517,7 +2516,7 @@ dump_rtl (suffix, decl, func, insns)
/* Routine to empty a dump file. */
static void
clean_dump_file (suffix)
- char *suffix;
+ const char *suffix;
{
char *dumpname;
@@ -3301,7 +3300,7 @@ compile_file (name)
void
rest_of_decl_compilation (decl, asmspec, top_level, at_end)
tree decl;
- char *asmspec;
+ const char *asmspec;
int top_level;
int at_end;
{
@@ -4254,7 +4253,7 @@ display_help ()
{
int undoc;
unsigned long i;
- char * lang;
+ const char * lang;
#ifndef USE_CPPLIB
printf ("Usage: %s input [switches]\n", progname);
@@ -4266,7 +4265,7 @@ display_help ()
for (i = NUM_ELEM (f_options); i--;)
{
- char * description = f_options[i].description;
+ const char * description = f_options[i].description;
if (description != NULL && * description != 0)
printf (" -f%-21s %s\n",
@@ -4282,7 +4281,7 @@ display_help ()
for (i = NUM_ELEM (W_options); i--;)
{
- char * description = W_options[i].description;
+ const char * description = W_options[i].description;
if (description != NULL && * description != 0)
printf (" -W%-21s %s\n",
@@ -4335,8 +4334,8 @@ display_help ()
for (i = 0; i < NUM_ELEM (documented_lang_options); i++)
{
- char * description = documented_lang_options[i].description;
- char * option = documented_lang_options[i].option;
+ const char * description = documented_lang_options[i].description;
+ const char * option = documented_lang_options[i].option;
if (description == NULL)
{
@@ -4381,8 +4380,8 @@ display_help ()
for (i = NUM_ELEM (target_switches); i--;)
{
- char * option = target_switches[i].name;
- char * description = target_switches[i].description;
+ const char * option = target_switches[i].name;
+ const char * description = target_switches[i].description;
if (option == NULL || * option == 0)
continue;
@@ -4400,8 +4399,8 @@ display_help ()
#ifdef TARGET_OPTIONS
for (i = NUM_ELEM (target_options); i--;)
{
- char * option = target_options[i].prefix;
- char * description = target_options[i].description;
+ const char * option = target_options[i].prefix;
+ const char * description = target_options[i].description;
if (option == NULL || * option == 0)
continue;
@@ -4982,7 +4981,7 @@ main (argc, argv)
-gdwarf -g3 is equivalent to -gdwarf3. */
static int type_explicitly_set_p = 0;
/* Indexed by enum debug_info_type. */
- static char *debug_type_names[] =
+ static const char *debug_type_names[] =
{
"none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
};
@@ -5223,7 +5222,7 @@ main (argc, argv)
static void
set_target_switch (name)
- char *name;
+ const char *name;
{
register size_t j;
int valid = 0;
@@ -5262,7 +5261,7 @@ set_target_switch (name)
static void
print_version (file, indent)
FILE *file;
- char *indent;
+ const char *indent;
{
fprintf (file, "%s%s%s version %s", indent, *indent != 0 ? " " : "",
language_string, version_string);
@@ -5285,7 +5284,7 @@ static int
print_single_switch (file, pos, max, indent, sep, term, type, name)
FILE *file;
int pos, max;
- char *indent, *sep, *term, *type, *name;
+ const char *indent, *sep, *term, *type, *name;
{
/* The ultrix fprintf returns 0 on success, so compute the result we want
here since we need it for the following test. */
@@ -5316,7 +5315,7 @@ static void
print_switch_values (file, pos, max, indent, sep, term)
FILE *file;
int pos, max;
- char *indent, *sep, *term;
+ const char *indent, *sep, *term;
{
size_t j;
char **p;
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 2f8698eb2cb..807fb25eaea 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -28,50 +28,64 @@ struct rtx_def;
extern int count_error PROTO ((int));
extern void strip_off_ending PROTO ((char *, int));
-extern void print_time PROTO ((char *, int));
+extern void print_time PROTO ((const char *, int));
extern void debug_start_source_file PROTO ((char *));
extern void debug_end_source_file PROTO ((unsigned));
extern void debug_define PROTO ((unsigned, char *));
extern void debug_undef PROTO ((unsigned, char *));
-extern void fatal PVPROTO ((char *, ...))
+extern void fatal PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-extern void fatal_io_error PROTO ((char *)) ATTRIBUTE_NORETURN;
-extern void pfatal_with_name PROTO ((char *)) ATTRIBUTE_NORETURN;
+extern void fatal_io_error PROTO ((const char *))
+ ATTRIBUTE_NORETURN;
+extern void pfatal_with_name PROTO ((const char *))
+ ATTRIBUTE_NORETURN;
extern void fatal_insn_not_found PROTO ((struct rtx_def *))
ATTRIBUTE_NORETURN;
-extern void fatal_insn PROTO ((char *, struct rtx_def *))
+extern void fatal_insn PROTO ((const char *, struct rtx_def *))
ATTRIBUTE_NORETURN;
-extern void warning PVPROTO ((char *, ...))
- ATTRIBUTE_PRINTF_1;
-extern void error PVPROTO ((char *, ...))
+extern void warning PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1;
-extern void pedwarn PVPROTO ((char *, ...))
+extern void error PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1;
-extern void pedwarn_with_file_and_line PVPROTO ((char *, int, char *, ...))
- ATTRIBUTE_PRINTF_3;
-extern void warning_with_file_and_line PVPROTO ((char *, int, char *, ...))
- ATTRIBUTE_PRINTF_3;
-extern void error_with_file_and_line PVPROTO ((char *, int, char *, ...))
- ATTRIBUTE_PRINTF_3;
-extern void sorry PVPROTO ((char *s, ...))
+extern void pedwarn PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1;
-extern void really_sorry PVPROTO((char *s, ...))
+extern void pedwarn_with_file_and_line PVPROTO ((const char *, int,
+ const char *, ...))
+ ATTRIBUTE_PRINTF_3;
+extern void warning_with_file_and_line PVPROTO ((const char *, int,
+ const char *, ...))
+ ATTRIBUTE_PRINTF_3;
+extern void error_with_file_and_line PVPROTO ((const char *, int,
+ const char *, ...))
+ ATTRIBUTE_PRINTF_3;
+extern void sorry PVPROTO ((const char *, ...))
+ ATTRIBUTE_PRINTF_1;
+extern void really_sorry PVPROTO((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-extern void default_print_error_function PROTO ((char *));
-extern void report_error_function PROTO ((char *));
+extern void default_print_error_function PROTO ((const char *));
+extern void report_error_function PROTO ((const char *));
-extern void rest_of_decl_compilation PROTO ((union tree_node *, char *, int, int));
+extern void rest_of_decl_compilation PROTO ((union tree_node *,
+ const char *, int, int));
extern void rest_of_type_compilation PROTO ((union tree_node *, int));
extern void rest_of_compilation PROTO ((union tree_node *));
-extern void pedwarn_with_decl PVPROTO ((union tree_node *, char *, ...));
-extern void warning_with_decl PVPROTO ((union tree_node *, char *, ...));
-extern void error_with_decl PVPROTO ((union tree_node *, char *, ...));
+
+/* The *_with_decl functions aren't suitable for ATTRIBUTE_PRINTF. */
+extern void pedwarn_with_decl PVPROTO ((union tree_node *,
+ const char *, ...));
+extern void warning_with_decl PVPROTO ((union tree_node *,
+ const char *, ...));
+extern void error_with_decl PVPROTO ((union tree_node *,
+ const char *, ...));
+
extern void announce_function PROTO ((union tree_node *));
-extern void error_for_asm PVPROTO((struct rtx_def *, char *, ...))
- ATTRIBUTE_PRINTF_2;
-extern void warning_for_asm PVPROTO((struct rtx_def *, char *, ...))
- ATTRIBUTE_PRINTF_2;
+extern void error_for_asm PVPROTO((struct rtx_def *,
+ const char *, ...))
+ ATTRIBUTE_PRINTF_2;
+extern void warning_for_asm PVPROTO((struct rtx_def *,
+ const char *, ...))
+ ATTRIBUTE_PRINTF_2;
#if defined (_JBLEN) || defined (setjmp)
extern void set_float_handler PROTO((jmp_buf));
extern int push_float_handler PROTO((jmp_buf, jmp_buf));
@@ -79,12 +93,13 @@ extern void pop_float_handler PROTO((int, jmp_buf));
#endif
#ifdef BUFSIZ
-extern void output_quoted_string PROTO ((FILE *, char *));
-extern void output_file_directive PROTO ((FILE *, char *));
+extern void output_quoted_string PROTO ((FILE *, const char *));
+extern void output_file_directive PROTO ((FILE *, const char *));
#endif
extern void fancy_abort PROTO ((void)) ATTRIBUTE_NORETURN;
extern void do_abort PROTO ((void)) ATTRIBUTE_NORETURN;
-extern void botch PROTO ((char *)) ATTRIBUTE_NORETURN;
+extern void botch PROTO ((const char *))
+ ATTRIBUTE_NORETURN;
#endif /* __GCC_TOPLEV_H */
diff --git a/gcc/tree.h b/gcc/tree.h
index cf3ec9dc368..1e8ed4d35e7 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2258,7 +2258,7 @@ extern void set_yydebug PROTO ((int));
extern void fixup_signed_type PROTO ((tree));
/* varasm.c */
-extern void make_decl_rtl PROTO ((tree, char *, int));
+extern void make_decl_rtl PROTO ((tree, const char *, int));
extern void make_decl_one_only PROTO ((tree));
extern int supports_one_only PROTO ((void));
extern void variable_section PROTO ((tree, int));
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 265987a4f3c..e3910b065d9 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -125,7 +125,7 @@ struct constant_descriptor;
struct rtx_const;
struct pool_constant;
-static char *strip_reg_name PROTO((char *));
+static const char *strip_reg_name PROTO((const char *));
static int contains_pointers_p PROTO((tree));
static void decode_addr_const PROTO((tree, struct addr_const *));
static int const_hash PROTO((tree));
@@ -263,7 +263,7 @@ in_data_section ()
void
named_section (decl, name, reloc)
tree decl;
- char *name;
+ const char *name;
int reloc;
{
if (decl != NULL_TREE
@@ -549,9 +549,9 @@ make_function_rtl (decl)
/* Given NAME, a putative register name, discard any customary prefixes. */
-static char *
+static const char *
strip_reg_name (name)
- char *name;
+ const char *name;
{
#ifdef REGISTER_PREFIX
if (!strncmp (name, REGISTER_PREFIX, strlen (REGISTER_PREFIX)))
@@ -572,7 +572,7 @@ strip_reg_name (name)
int
decode_reg_name (asmspec)
- char *asmspec;
+ const char *asmspec;
{
if (asmspec != 0)
{
@@ -601,7 +601,7 @@ decode_reg_name (asmspec)
#ifdef ADDITIONAL_REGISTER_NAMES
{
- static struct { char *name; int number; } table[]
+ static struct { const char *name; int number; } table[]
= ADDITIONAL_REGISTER_NAMES;
for (i = 0; i < (int)(sizeof (table) / sizeof (table[0])); i++)
@@ -633,7 +633,7 @@ decode_reg_name (asmspec)
void
make_decl_rtl (decl, asmspec, top_level)
tree decl;
- char *asmspec;
+ const char *asmspec;
int top_level;
{
register char *name = 0;
OpenPOWER on IntegriCloud