diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-06 03:40:46 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-02-06 03:40:46 +0000 |
commit | 74647769a1f28f5645a26aff1a84081c26370bcc (patch) | |
tree | eeea9d658a7f6cacbf960eeccca8c5075429a00a /gcc/diagnostic.c | |
parent | a2de05998e7c9ca842ef1a986570f0ea2a658a8a (diff) | |
download | gcc-74647769a1f28f5645a26aff1a84081c26370bcc.tar.gz |
* Makefile.in (c-common.o): Depend on $(EXPR_H).
* c-common.c: Include expr.h.
* c-pragma.c (mark_align_stack): Add prototype.
* caller-save.c (add_stored_regs): Likewise.
* combine.c (record_promoted_value): Likewise.
* i386.c (ix86_sched_reorder_pentium, ix86_sched_reorder_ppro):
Likewise.
* cppinit.c (new_pending_define): Likewise.
* cpplib.c (skip_block_comment, skip_line_comment): Likewise.
* dwarf2out.c (save_rtx, splice_child_die, reverse_die_lists,
AT_class, AT_flag, AT_int, AT_unsigned, AT_string, AT_ref, AT_loc,
AT_addr, AT_lbl, get_AT_ref, free_AT, free_die, local_scope_p,
class_scope_p): Likewise.
* dwarf2out.h (dwarf2out_set_demangle_name_func,
dwarf2out_add_library_unit_info): Likewise.
* ggc.h (ggc_page_print_statistics): Likewise.
* haifa-sched.c (propagate_deps): Likewise.
* reg-stack.c (next_flags_user, record_label_references): Likewise.
* rtl.h (set_stack_check_libfunc): Likewise.
* toplev.h (set_fatal_function): Likewise.
* toplev.c (set_fatal_function): Delete prototype.
* diagnostic.c: Deconstify functions returning malloc'ed ptrs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 97ec8c00d06..4aa084b379b 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -45,16 +45,15 @@ Boston, MA 02111-1307, USA. */ struct output_buffer { struct obstack obstack; /* where we build the text to output */ - const char *prefix; /* prefix of every new line */ + char *prefix; /* prefix of every new line */ int line_length; /* current line length (in characters) */ int max_length; /* maximum characters per line */ }; /* Prototypes. */ static int doing_line_wrapping PARAMS ((void)); -static void init_output_buffer PARAMS ((struct output_buffer*, - const char *, int)); -static const char *get_output_prefix PARAMS ((const struct output_buffer *)); +static void init_output_buffer PARAMS ((struct output_buffer*, char *, int)); +static char *get_output_prefix PARAMS ((const struct output_buffer *)); static int output_space_left PARAMS ((const struct output_buffer *)); static void emit_output_prefix PARAMS ((struct output_buffer *)); static void output_newline PARAMS ((struct output_buffer *)); @@ -62,10 +61,10 @@ static void output_append PARAMS ((struct output_buffer *, const char *, const char *)); static void output_puts PARAMS ((struct output_buffer *, const char *)); static void dump_output PARAMS ((struct output_buffer *, FILE *)); -static const char *vbuild_message_string PARAMS ((const char *, va_list)); -static const char *build_message_string PARAMS ((const char *, ...)) +static char *vbuild_message_string PARAMS ((const char *, va_list)); +static char *build_message_string PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; -static const char *build_location_prefix PARAMS ((const char *, int, int)); +static char *build_location_prefix PARAMS ((const char *, int, int)); static void voutput_notice PARAMS ((struct output_buffer *, const char *, va_list)); static void output_printf PARAMS ((struct output_buffer *, const char *, ...)) @@ -150,7 +149,7 @@ set_message_length (n) static void init_output_buffer (buffer, prefix, max_length) struct output_buffer *buffer; - const char *prefix; + char *prefix; int max_length; { obstack_init (&buffer->obstack); @@ -161,7 +160,7 @@ init_output_buffer (buffer, prefix, max_length) /* Return BUFFER's prefix. */ -static const char * +static char * get_output_prefix (buffer) const struct output_buffer *buffer; { @@ -263,16 +262,16 @@ dump_output (buffer, file) struct output_buffer *buffer; FILE *file; { - const char *text; + char *text; obstack_1grow (&buffer->obstack, '\0'); text = obstack_finish (&buffer->obstack); fputs (text, file); - obstack_free (&buffer->obstack, (char *)text); + obstack_free (&buffer->obstack, text); buffer->line_length = 0; } -static const char * +static char * vbuild_message_string (msgid, ap) const char *msgid; va_list ap; @@ -286,14 +285,14 @@ vbuild_message_string (msgid, ap) /* Return a malloc'd string containing MSGID formatted a la printf. The caller is reponsible for freeing the memory. */ -static const char * +static char * build_message_string VPARAMS ((const char *msgid, ...)) { #ifndef ANSI_PROTOTYPES const char *msgid; #endif va_list ap; - const char *str; + char *str; VA_START (ap, msgid); @@ -312,7 +311,7 @@ build_message_string VPARAMS ((const char *msgid, ...)) /* Return a malloc'd string describing a location. The caller is responsible for freeing the memory. */ -static const char * +static char * build_location_prefix (file, line, warn) const char *file; int line; @@ -342,10 +341,10 @@ voutput_notice (buffer, msgid, ap) const char *msgid; va_list ap; { - const char *message = vbuild_message_string (msgid, ap); + char *message = vbuild_message_string (msgid, ap); output_puts (buffer, message); - free ((char *)message); + free (message); } @@ -392,7 +391,7 @@ line_wrapper_printf VPARAMS ((FILE *file, const char *msgid, ...)) msgid = va_arg (ap, const char *); #endif - init_output_buffer (&buffer, (const char *)NULL, output_maximum_width); + init_output_buffer (&buffer, NULL, output_maximum_width); voutput_notice (&buffer, msgid, ap); dump_output (&buffer, file); @@ -1006,7 +1005,7 @@ default_print_error_function (file) { if (last_error_function != current_function_decl) { - const char *prefix = NULL; + char *prefix = NULL; struct output_buffer buffer; if (file) @@ -1056,7 +1055,7 @@ default_print_error_function (file) if (doing_line_wrapping ()) dump_output (&buffer, stderr); - free ((char *)prefix); + free (prefix); } } |