From a72462a4fd95e8a3f54d9a7a775a7f8ecbf9c4f0 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Wed, 23 Aug 2000 06:36:15 +0000 Subject: [PATCH] decl.c (init_decl_processing): Remove bogus initialization. * decl.c (init_decl_processing): Remove bogus initialization. * error.c (lang_print_error_function): Restore here. (init_error): Initialize print_error_function. From-SVN: r35902 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/decl.c | 1 - gcc/cp/error.c | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 22466d78e26..8ddd8a03f42 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2000-08-23 Gabriel Dos Reis + + * decl.c (init_decl_processing): Remove bogus initialization. + * error.c (lang_print_error_function): Restore here. + (init_error): Initialize print_error_function. + 2000-08-22 Theodore Papadopoulo * decl2.c (arg_assoc): Revert my 2000-08-11 change. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d6ee50f2144..f035f2f980a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6651,7 +6651,6 @@ init_decl_processing () /* Show we use EH for cleanups. */ using_eh_for_cleanups (); - print_error_function = NULL; valid_lang_attribute = cp_valid_lang_attribute; /* Maintain consistency. Perhaps we should just complain if they diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d58c7f11d2c..012bbcf6aee 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -97,6 +97,7 @@ static void dump_scope PARAMS ((tree, enum tree_string_flags)); static void dump_template_parms PARAMS ((tree, int, enum tree_string_flags)); static const char *function_category PARAMS ((tree)); +static void lang_print_error_function PARAMS ((const char *)); static void maybe_print_instantiation_context PARAMS ((output_buffer *)); static void print_instantiation_full_context PARAMS ((output_buffer *)); static void print_instantiation_partial_context PARAMS ((output_buffer *, tree, @@ -152,6 +153,7 @@ init_error () gcc_obstack_init (&scratch_obstack); scratch_firstobj = (char *)obstack_alloc (&scratch_obstack, 0); + print_error_function = lang_print_error_function; lang_diagnostic_starter = cp_diagnostic_starter; lang_diagnostic_finalizer = cp_diagnostic_finalizer; } @@ -2431,6 +2433,19 @@ cv_to_string (p, v) return (char *)obstack_base (&scratch_obstack); } +static void +lang_print_error_function (file) + const char *file; +{ + output_state os; + + default_print_error_function (file); + os = output_buffer_state (diagnostic_buffer); + output_set_prefix (diagnostic_buffer, file); + maybe_print_instantiation_context (diagnostic_buffer); + output_buffer_state (diagnostic_buffer) = os; +} + static void cp_diagnostic_starter (buffer, dc) output_buffer *buffer; -- 2.30.2