Commit Graph

278 Commits

Author SHA1 Message Date
Diego Novillo 68a607d814 [multiple changes]
2009-04-14  Diego Novillo  <dnovillo@google.com>
	    Le-Chun Wu  <lcwu@google.com>

	* configure.ac: Add --enable-plugin support.
	Define ENABLE_PLUGIN and PLUGINLIBS when specified.
	* Makefile.in (PLUGIN_H): Define.
	Export ENABLE_PLUGIN and GMPINC to site.exp.
	Add PLUGINLIBS to link command.
	Add/modify dependencies for plugin.o and files including plugin.h.
	(plugin.o): New.
	* config.in: Regenerate.
	
	* opts.c (common_handle_option): Handle OPT_fplugin_ and
	OPT_fplugin_arg_.

2009-04-14  Le-Chun Wu  <lcwu@google.com>

	* tree-pass.h (register_one_dump_file): Add a prototype for
	register_one_dump_file.
	* toplev.c (compile_file): Call initialize_plugins.
	(do_compile): Call invoke_plugin_callbacks.
	(toplev_main): Call invoke_plugin_callbacks.
	* common.opt: Add -fplugin= and -fplugin-arg-.
	* gcc-plugin.h: New public header file for plugins to include.
	* plugin.c: New source file.
	* plugin.h: New internal header file.
	* passes.c (register_one_dump_file): Make it external.
	
	* c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks.

2009-04-14  Diego Novillo  <dnovillo@google.com>

	* doc/plugins.texi: New.
	* doc/gccint.texi: Add reference to Plugins chapter.
	* doc/invoke.texi: Document -fplugin and -fplugin-arg
	* diagnostic.c (diagnostic_report_diagnostic): Warn about
	loaded plugins, if any.
	* timevar.def (TV_PLUGIN_INIT): Define.
	(TV_PLUGIN_RUN): Define.
	* plugin.c: Include timevar.h
	(plugins_active_p): New.
	(dump_active_plugins): New.
	(debug_active_plugins): New.


cp/ChangeLog

2009-04-14  Le-Chun Wu  <lcwu@google.com>

	* Make-lang.in: Modify dependencies of files including plugin.h.
	* decl.c (finish_function): Call invoke_plugin_callbacks.
	* parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.

From-SVN: r146059
2009-04-14 16:18:49 -04:00
Joseph Myers 148e4216a4 re PR preprocessor/34695 (Preprocessor warning->error conversion from -Werror is silent)
PR preprocessor/34695

gcc:
	* Makefile.in (c-opts.o): Depend on c-tree.h.
	* c-common.c: Move down include of diagnostic.h.
	(done_lexing, c_cpp_error): New.
	* c-common.h (done_lexing): Declare.
	* c-decl.c (c_write_global_declarations): Don't check cpp_errors
	(parse_in).
	* c-opts.c: Include c-tree.h.
	(c_common_init_options): Set preprocessor error callback.
	(c_common_handle_option): Do not set preprocessor
	inhibit_warnings, warnings_are_errors, warn_system_headers,
	pedantic_errors or inhibit_warnings flags.
	(c_common_post_options): Do not check cpp_errors (parse_in).
	(c_common_finish): Do not output dependencies if there were
	errors.  Do not check return value of cpp_finish.
	* c-ppoutput.c (pp_file_change): Set input_location.
	* c-tree.h (c_cpp_error): Declare.
	* diagnostic.c (diagnostic_set_info_translated): Also initialize
	override_column.
	(diagnostic_build_prefix): Check override_column.
	* diagnostic.h (diagnostic_info): Add override_column field.
	(diagnostic_override_column): Define.

gcc/cp:
	* cp-tree.h (cp_cpp_error): Remove.
	* error.c (cp_cpp_error): Remove.
	* parser.c (cp_lexer_new_main): Set done_lexing instead of
	client_diagnostic and error callback.

gcc/fortran:
	* cpp.c (cb_cpp_error): New.
	(gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings.
	Don't check cpp_errors (cpp_in).
	(gfc_cpp_init_0): Set cb->error.

gcc/testsuite:
	* gcc.dg/builtin-redefine.c, gcc.dg/cpp/redef2.c,
	gcc.dg/cpp/redef3.c, gcc.dg/cpp/trad/redef2.c: Use dg-message
	instead of dg-warning for "previous definition" messages.
	* gcc.dg/cpp/Wvariadic-1.c, gcc.dg/cpp/Wvariadic-3.c: Expect
	"warnings being treated as errors" message.
	* gcc.dg/fltconst-1.c: Use -fshow-column.

libcpp:
	* makedepend.c: Remove.
	* Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
	(all, clean, TAGS_SOURCES, include): Remove makedepend handling.
	* directives.c (cpp_errors): Remove.
	* errors.c (print_location, _cpp_begin_message, v_message):
	Remove.
	(cpp_error, cpp_error_with_line): Always use error callback.
	(cpp_error, cpp_error_with_line, cpp_errno): Return bool.
	* include/cpplib.h (cpp_options): Remove pedantic_errors,
	inhibit_warnings, warn_system_headers, inhibit_errors,
	warnings_are_errors, client_diagnostic.
	(cpp_callbacks): Add extra arguments to error callback; make it
	return bool.
	(cpp_finish): Return void.
	(cpp_destroy): Remove inaccurate comment about return value.
	(cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
	(CPP_DL_NOTE): Define.
	* include/line-map.h (linemap_print_containing_files): Remove.
	* init.c (cpp_finish): Do not check for or return number of
	errors.
	* internal.h (cpp_reader): Remove errors field.
	* line-map.c (linemap_print_containing_files): Remove.
	* macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
	about previous definition.  Only emit it if previous diagnostic
	was emitted.

From-SVN: r145263
2009-03-29 23:56:07 +01:00
Aldy Hernandez a63068b6dd diagnostic.c (error_at): New.
* diagnostic.c (error_at): New.
        * toplev.h (error_at): New prototype.
        * c-typeck.c (build_array_ref): Call error_at instead of error.
        Pass location to pedwarn.
cp/
        * typeck.c (build_array_ref): Use new location argument.
        * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
        * call.c (build_new_op): Same.
        * decl2.c (grok_array_decl): Same.
        * cp-tree.h (build_array_ref): Add location argument to prototype.

From-SVN: r139924
2008-09-03 01:00:04 +00:00
Manuel López-Ibáñez 509c9d60e4 diagnostic.c (pedwarn_at): Rename as pedwarn.
2008-08-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostic.c (pedwarn_at): Rename as pedwarn.
	(pedwarn): Delete.
	* toplev.h (pedwarn_at): Likewise.
	* builtins.c: Update all calls to pedwarn.
	* c-lex.c: Likewise.
	* toplev.c: Likewise.
	* c-tree.h: Likewise.
	* c-decl.c: Likewise.
	* c-errors.c: Likewise.
	* c-typeck.c: Likewise.
	* c-common.c: Likewise.
	* c-parser.c: Likewise.
cp/
	* typeck.c: Update all calls to pedwarn.
	* decl.c: Likewise.
	* call.c: Likewise.
	* error.c: Likewise.
	* pt.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
fortran/	
	* f95-lang.c: Update all calls to pedwarn.

From-SVN: r139373
2008-08-21 10:55:13 +00:00
Manuel López-Ibáñez 1f5b386928 diagnostic.c (inform): Add an explicit location_t parameter.
2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostic.c (inform): Add an explicit location_t parameter.
	* toplev.h (inform): Update declaration.
	* builtins.c: Update all calls to inform.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-pragma.c: Likewise.
	* c-typeck.c: Likewise.
	* coverage.c: Likewise.
	* opts.c: Likewise.
	* toplev.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-ssa.c: Likewise.
cp/	
	* parser.c: Update all calls to inform.
	* typeck.c: Likewise.
	* init.c: Likewise.
	* class.c: Likewise.
	* call.c: Likewise.
	* method.c: Likewise.
	* friend.c: Likewise.
	* typeck2.c: Likewise.
	* pt.c: Likewise.
	* name-lookup.c: Likewise.
	* lex.c: Likewise.

From-SVN: r139293
2008-08-20 13:35:00 +00:00
Manuel López-Ibáñez cbe5f3b371 diagnostics.c (permerror_at): Rename as permerror.
2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostics.c (permerror_at): Rename as permerror.
	(permerror): Delete.
	* toplev.h: Likewise.
cp/	
	* typeck.c: Update all callers.
	* init.c: Likewise.
	* class.c: Likewise.
	* decl.c: Likewise.
	* call.c: Likewise.
	* except.c: Likewise.
	* cvt.c: Likewise.
	* typeck2.c: Likewise.
	* pt.c: Likewise.
	* semantics.c: Likewise.
	* name-lookup.c: Likewise.
	* lex.c: Likewise.
	* decl2.c: Likewise.
	* parser.c: Likewise.

From-SVN: r139193
2008-08-18 11:17:52 +00:00
Manuel López-Ibáñez 85790e6677 re PR c/15236 (pedantic switch modifies treatment of non-ISO compliant enumerations)
2008-08-13  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR c/15236
	* diagnostic.c (pedwarn_at): New.
	* toplev.h (pedwarn_at): Declare.
	* c-tree.h (build_enumerator): Update declaration.
	* c-decl.c (finish_enum): Update comment.
	(build_enumerator): Take a location parameter. Give a pedwarn but do
	not perform any conversion.
	* c-parser.c (c_parser_enum_specifier): Set correct location for
	enumerator.
testsuite/
	* gcc.dg/pr15236.c: New.
	* gcc.dg/torture/pr25183.c: Update.

From-SVN: r139050
2008-08-13 10:19:03 +00:00
Manuel López-Ibáñez 71205d170c re PR other/36901 (pedwarn() + -pedantic-errors + -w (inhibit_warnings) should not emit errors)
2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 36901
	* diagnostic.def (DK_PEDWARN, DK_PERMERROR): New.  
	* diagnostic.c (pedantic_warning_kind, permissive_error_kind):
	Moved from diagnostic.h
	(diagnostic_report_diagnostic): Return bool. Handle DK_PEDWARN and
	DK_PERMERROR.
	(emit_diagnostic): New.
	(warning0, pedwarn0): Delete.
	(warning, warning_at, pedwarn, permerror): Return bool.  
	* diagnostic.h (pedantic_warning_kind, permissive_error_kind):
	Moved to diagnostic.c.
	(struct diagnostic_context): Use correct type for
	classify_diagnostic.
	(diagnostic_report_diagnostic): Update declaration.
	(emit_diagnostic): Declare.
	* errors.c (warning): Return bool.  
	* errors.h (warning): Update declaration.
	* toplev.h (warning0, pedwarn0): Delete.
	(warning, warning_at, pedwarn, permerror): Return bool.
	* c-errors.c (pedwarn_c99, pedwarn_c90): Use DK_PEDWARN.
	* c-decl.c (locate_old_decl): Delete 'diag' argument. Always use
	inform. Update all calls.
	(diagnose_mismatched_decls): Check return value of warning/pedwarn
	before giving informative note.
	(implicit_decl_warning): Likewise.  
	* c-typeck.c (build_function_call): Likewise.  
	* tree-sssa.c (warn_uninit): Likewise.  
	* builtins.c (gimplify_va_arg_expr): Likewise.
fortran/
	* f95-lang.c (gfc_mark_addressable): Use "pedwarn (0," instead of
	'pedwarn0'.
cp/
	* cp-tree.h (struct diagnostic_context, struct diagnostic_info):
	Delete forward declarations. Check that toplev.h has not been
	included before this file. Include toplev.h and diagnostic.h.
	* error.c (cp_cpp_error): Use DK_PEDWARN.
	(cxx_incomplete_type_diagnostic): Update declaration.
	(cxx_incomplete_type_error): Use DK_ERROR.
	* typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
	as argument. Use emit_diagnostic.
	(cxx_incomplete_type_error): Use DK_ERROR.
	(add_exception_specifier): Use diagnostic_t instead of custom
	codes.  
	* typeck.c (complete_type_or_else): Update call to
	cxx_incomplete_type_diagnostic.
	* init.c (build_delete): Likewise.  
	* call.c (diagnostic_fn_t): Remove unused typedef.
	(build_temp): Pass a pointer to diagnostic_t.
	(convert_like_real): Use emit_diagnostic.
	(joust): Check return value of warning before giving informative
	note.  
	* friend.c (do_friend): Check return value of warning
	before giving informative note.
	* parser.c (cp_parser_template_id): Likewise.

testsuite/
	* gcc.dg/pr36901-1.c: New.
	* gcc.dg/pr36901-3.c: New.
	* gcc.dg/pr36901-2.c: New.
	* gcc.dg/pr36901-4.c: New.
	* gcc.dg/pr36901-system.h: New.
	* gcc.dg/pr36901.h: New.
	* gcc.target/powerpc/altivec-macros.c: Update.
	* gcc.target/i386/regparm.c: Update.
	* gcc.dg/funcdef-var-1.c: Update.
	* gcc.dg/parm-mismatch-1.c: Update.
	* gcc.dg/attr-noinline.c: Update.
	* gcc.dg/wtr-static-1.c: Update.
	* gcc.dg/redecl-11.c: Update.
	* gcc.dg/pr27953.c: Update.
	* gcc.dg/proto-1.c: Update.
	* gcc.dg/decl-3.c: Update.
	* gcc.dg/redecl-13.c: Update.
	* gcc.dg/pr15360-1.c: Update.
	* gcc.dg/redecl-15.c: Update.
	* gcc.dg/enum-compat-1.c: Update.
	* gcc.dg/dll-3.c: Update.
	* gcc.dg/array-5.c: Update.
	* gcc.dg/Wredundant-decls-2.c: Update.
	* gcc.dg/inline4.c: Update.
	* gcc.dg/redecl-2.c: Update.
	* gcc.dg/inline-14.c: Update.
	* gcc.dg/tls/diag-3.c: Update.
	* gcc.dg/funcdef-var-2.c: Update.
	* gcc.dg/20041213-1.c: Update.
	* gcc.dg/old-style-then-proto-1.c: Update.
	* gcc.dg/decl-2.c: Update.
	* gcc.dg/redecl-12.c: Update.
	* gcc.dg/decl-4.c: Update.
	* gcc.dg/Wshadow-1.c: Update.
	* gcc.dg/transparent-union-2.c: Update.
	* gcc.dg/visibility-7.c: Update.
	* gcc.dg/dll-2.c: Update.
	* gcc.dg/redecl-16.c: Update.
	* gcc.dg/inline1.c: Update.
	* gcc.dg/decl-8.c: Update.
	* gcc.dg/nested-redef-1.c: Update.
	* gcc.dg/inline3.c: Update.
	* gcc.dg/redecl-1.c: Update.
	* gcc.dg/inline5.c: Update.
	* gcc.dg/pr35899.c: Update.
	* gcc.dg/noncompile/label-lineno-1.c: Update.
	* gcc.dg/noncompile/label-1.c: Update.
	* gcc.dg/noncompile/20020220-1.c: Update.
	* gcc.dg/noncompile/redecl-1.c: Update.
	* gcc.dg/redecl-5.c: Update.
	* gcc.dg/qual-return-3.c: Update.
	* gcc.dg/label-decl-4.c: Update.

From-SVN: r138893
2008-08-08 23:57:19 +00:00
Manuel López-Ibáñez 7e99f74bbb re PR c++/26785 ("extra qualification" error gives line number of end of declaration)
2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 26785
	* diagnostic.c (permerror_at): New.
	* toplev.h (permerror_at): Declare.
cp/
	* decl.c (grokdeclarator): Use explicit location with
        permerror_at.
testsuite/
	* g++.dg/warn/pr26785.C: New.

From-SVN: r138816
2008-08-06 16:37:06 +00:00
Manuel López-Ibáñez fcf73884fb re PR c/35058 (-Werror= works only with some warnings)
2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	PR 35058
	* diagnostic.c (pedwarn): Add opt parameter.
	(pedwarn0): New.
	* c-tree.h (pedwarn_init): Add opt parameter.
	(pedwarn_c90): Likewise.
	(pedwarn_c99): Likewise.
	* c-errors.c (pedwarn_c99): Likewise.
	(pedwarn_c90): Likewise.
	* toplev.h (pedwarn): Update declaration.
	(pedwarn0): Declare.
	* c-lex.c: All calls to pedwarn changed.
	* builtins.c: All calls to pedwarn changed.
	* toplev.c: All calls to pedwarn changed.
	* c-decl.c: All calls to pedwarn changed.
	* c-typeck.c: All calls to pedwarn changed.
	* c-common.c: All calls to pedwarn changed.
	* c-parser.c: All calls to pedwarn changed.
cp/
	* typeck.c: All calls to pedwarn changed.
	* decl.c: All calls to pedwarn changed.
	* call.c: All calls to pedwarn changed.
	* error.c: All calls to pedwarn changed.
	* typeck2.c: All calls to pedwarn changed.
	* pt.c: All calls to pedwarn changed.
	* name-lookup.c: All calls to pedwarn changed.
	* parser.c: All calls to pedwarn changed.
fortran/
	* f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
testsuite/
	* gcc.dg/Wdeclaration-after-statement-3.c: New.
	* gcc/testsuite/gcc.dg/Wpointer-arith.c: New.

From-SVN: r138089
2008-07-23 15:57:49 +00:00
Rafael Avila de Espindola aa14403d28 Makefile.in: Replace toplev.h with TOPLEV_H.
2007-07-21  Rafael Avila de Espindola  <espindola@google.com>

	* Makefile.in: Replace toplev.h with TOPLEV_H.
	* c-decl.c (merge_decls): Don't set DECL_IN_SYSTEM_HEADER.
	* c-lex.c (fe_file_change): Don't set in_system_header.
	* c-parser.c (c_token): Remove in_system_header.
	(c_lex_one_token): Don't set in_system_header.
	(c_parser_set_source_position_from_token): Don't set in_system_header.
	* diagnostic.c (diagnostic_report_diagnostic): Use location from
	diagnostic_info.
	(warning_at): New.
	* diagnostic.h (diagnostic_report_warnings_p): Add LOC argument.
	* flags.h (in_system_header): Remove.
	* function.c (saved_in_system_header): Remove.
	(push_cfun): Don't set in_system_header.
	(pop_cfun): Don't set in_system_header.
	(push_struct_function): Don't set in_system_header.
	* input.h (expanded_location): Add sysp.
	(in_system_header_at): New.
	(in_system_header): New.
	* toplev.c (in_system_header): Remove.
	* toplev.h: Include input.h
	(warning_at): New.
	* tree-cfg.c (execute_warn_function_return): Call warning_at.
	* tree-ssa.c (warn_uninit): Call warning_at.
	(warn_uninitialized_var): Update calls to warn_uninit.
	(warn_uninitialized_phi): Update calls to warn_uninit.
	* tree.c (make_node_stat): Don't set DECL_IN_SYSTEM_HEADER.
	(expand_location): Initialize xloc.sysp.
	* tree.h (DECL_IN_SYSTEM_HEADER): Use in_system_header_at.
	(tree_decl_with_vis): Remove in_system_header_flag.

2007-07-21  Rafael Avila de Espindola  <espindola@google.com>

	* parser.c (cp_token): Remove in_system_header.
	(eof_token): Remove in_system_header.
	(cp_lexer_get_preprocessor_token): Don't set in_system_header.
	(cp_lexer_set_source_position_from_token): Don't set in_system_header.
	(cp_parser_member_declaration):  Use in_system_header_at.
	* pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
	(pop_tinst_level): Don't set in_system_header.
	(instantiate_class_template): Don't set in_system_header.
	(instantiate_decl): Don't set in_system_header.
	(instantiate_pending_templates): Don't set in_system_header.

From-SVN: r138031
2008-07-21 14:29:27 +00:00
Manuel López-Ibáñez 52249a2e3f diagnostic.c (diagnostic_count_diagnostic): Delete.
2008-03-24  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

	* diagnostic.c (diagnostic_count_diagnostic): Delete.
	(diagnostic_report_diagnostic): Update. Handle ICEs here.

From-SVN: r133478
2008-03-24 14:19:55 +00:00
Manuel López-Ibáñez 393eda6a41 re PR c++/24924 (front end and preprocessor pedantic_errors settings should agree)
2008-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org> 

	PR 24924
	* c-common.c (flag_permissive): Delete.
	(constant_expression_warnings): Check flags first.
	(constant_expression_error): New.
	* c-common.h (flag_permissive): Delete.
	(constant_expression_error): Declare.
	* flags.h (flag_permissive): Declare. Update description.
	* diagnostic.c (pedwarn): Update.
	(permerror): New.
	* diagnostic.h: (pedantic_error_kind): Rename as pedantic_warning_kind.
	(permissive_error_kind): New.
	* toplev.c (flag_permissive): Define. Update description.
	* toplev.h (permissive_error_kind): Declare.
	* c-errors.c (pedwarn_c99): Use pedantic_warning_kind.
	(pedwarn_c90): Use pedantic_warning_kind.
	* c-opts.c (c_common_post_options): flag_permissive does not affect
	flag_pedantic_errors.
cp/
	* class.c (finish_struct_anon): Use permerror instead of pedwarn.
	(check_field_decls): Likewise.
	(note_name_declared_in_class): Likewise.
	* call.c (build_new_op): Likewise.
	(convert_like_real): Likewise.
	(build_over_call): Likewise.
	* lex.c (unqualified_fn_lookup_error): Likewise.
	* parser.c (cp_parser_template_id): Likewise.
	* cvt.c (warn_ref_binding): Likewise.
	(convert_to_reference): Likewise.
	(ocp_convert): Likewise.
	(convert_to_void): Use error instead of pedwarn.
	* error.c (cp_cpp_error): Use pedantic_warning_kind.
	* decl.c (compute_array_index_type): Use constant_expression_error.
testsuite/
	* g++.dg/cpp/string-2.C: This is a warning now.
	* g++.dg/cpp/pedantic-errors.C: -pedantic-errors is not enabled by
	default, so add it.

From-SVN: r132817
2008-03-02 15:45:29 +00:00
Tom Tromey 966e8f4d3f toplev.c (input_file_stack, [...]): Remove.
gcc
	* toplev.c (input_file_stack, input_file_stack_tick, fs_p,
	input_file_stack_history, input_file_stack_restored): Remove.
	(push_srcloc, pop_srcloc, restore_input_file_stack): Likewise.
	* input.h (struct file_stack): Remove.
	(push_srcloc, pop_srcloc, restore_input_file_stack): Likewise.
	(input_file_stack, input_file_stack_tick, INPUT_FILE_STACK_BITS):
	Likewise.
	* diagnostic.h (struct diagnostic_context) <last_module>: Change
	type.
	(diagnostic_last_module_changed): Add 'map' argument.
	(diagnostic_set_last_function): Likewise.
	* diagnostic.c (undiagnostic_report_current_module): Iterate using
	line map, not input_file_stack.
	* c-lex.c (fe_file_change): Don't use push_srcloc or pop_srcloc.
gcc/cp
	* parser.c (struct cp_token) <input_file_stack_index>: Remove.
	(cp_lexer_get_preprocessor_token): Update.
	(cp_lexer_set_source_position_from_token): Don't call
	restore_input_file_stack.
	* lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
gcc/testsuite
	* g++.dg/warn/pragma-system_header2.C: Ignore "included from"
	line.

From-SVN: r132775
2008-02-29 20:09:05 +00:00
Tom Tromey 2d593c86cf system.h (USE_MAPPED_LOCATION): Poison.
gcc
	* system.h (USE_MAPPED_LOCATION): Poison.
	* Makefile.in (GTFILES): Put CPP_ID_DATA_H first.
	* tree-cfg.c (make_cond_expr_edges): Remove old location code.
	(make_goto_expr_edges): Likewise.
	(remove_bb): Likewise.
	(execute_warn_function_return): Likewise.
	* basic-block.h (struct edge_def) <goto_locus>: Change type to
	location_t.
	* c-common.c (fname_decl): Remove old location code.
	* tree-vect-transform.c (vect_finish_stmt_generation): Remove old
	location code.
	* rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location
	variant.
	(ASM_INPUT_SOURCE_LOCATION): Likewise.
	(gen_rtx_ASM_INPUT): Likewise.
	(gen_rtx_ASM_INPUT_loc): Likewise.
	(get_rtx_asm_OPERANDS): Remove.
	* cfglayout.c (insn_locators_alloc): Remove old location code.
	(set_curr_insn_source_location): Likewise.
	(curr_insn_locator): Likewise.
	* print-tree.c (print_node): Remove old location code.
	* tree-mudflap.c (mf_varname_tree): Remove old location code.
	(mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION.
	* cfgexpand.c (expand_gimple_cond_expr): Don't use
	location_from_locus.
	(construct_exit_block): Remove old location code.
	* emit-rtl.c (force_next_line_note): Remove old location code.
	* profile.c (branch_prob): Remove old location code.
	* tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
	LOC_LINE): Remove old-location variants.
	* langhooks.c (lhd_print_error_function): Remove old location
	code.
	* configure, config.in: Rebuilt.
	* configure.ac (--enable-mapped-location): Remove.
	* c-decl.c (c_init_decl_processing): Remove old location code.
	(finish_function): Likewise.
	* recog.c (decode_asm_operands): Remove old location code.
	* c-pch.c (c_common_read_pch): Remove old location code.
	* rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location
	variants.
	* gimple-low.c (lower_function_body): Remove old location code.
	* toplev.c (unknown_location): Remove.
	(push_srcloc): Remove old-location variant.
	(process_options): Remove old location code.
	(lang_dependent_init): Likewise.
	* input.h (UNKNOWN_LOCATION): Move definition.
	(location_t): Undeprecate.
	(source_locus): Remove.
	(location_from_locus): Remove.
	(struct location_s): Remove.
	Remove all old-location code.
	(input_line, input_filename): Remove.
	* final.c (final_scan_insn): Remove old location code.
	* diagnostic.c (diagnostic_build_prefix): Remove
	USE_MAPPED_LOCATION test.
	* tree.h (gimple_stmt) <locus>: Now a location_t.
	(tree_exp) <locus>: Likewise.
	(DECL_IS_BUILTIN): Remove old-location variant.
	(annotate_with_file_line, annotate_with_locus): Likewise.
	(expr_locus, set_expr_locus): Update.
	* tree.c (build1_stat): Remove old location code.
	(last_annotated_node): Remove.
	(annotate_with_file_line): Remove old-location variant.
	(annotate_with_locus): Likewise.
	(expr_location): Remove old location code.
	(set_expr_location): Likewise.
	(expr_has_location): Likewise.
	(expr_locus): Likewise.
	(set_expr_locus): Likewise.
	(expr_filename): Don't use location_from_locus.
	(expr_lineno): Likewise.
	* rtl-error.c (location_for_asm): Remove old location code.
	* c-lex.c (cb_line_change): Remove old location code.
	(fe_file_change): Likewise.
	(cb_def_pragma): Likewise.
	(c_lex_with_flags): Likewise.
	* gengtype.c (do_typedef): Don't special-case location types.
	(define_location_structures): Remove.
	(main): Don't call define_location_structures.
	* tree-pretty-print.c (dump_implicit_edges): Remove old location
	code.
gcc/ada
	* misc.c (internal_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* trans.c (gigi): Remove test of USE_MAPPED_LOCATION.
	(Sloc_to_locus): Remove old location code.
gcc/cp
	* parser.c (eof_token): Remove old location code.
	(check_empty_body): Remove test of USE_MAPPED_LOCATION.
	* decl2.c (generate_ctor_or_dtor_function): Remove old location
	code.
	(cp_write_global_declarations): Likewise.
	* lex.c (cxx_init): Remove old location code.
	(handle_pragma_implementation): Remove test of
	USE_MAPPED_LOCATION.
	* pt.c (tsubst): Remove old location code.
	* error.c (cp_print_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* decl.c (pop_label): Remove old location code.
	(finish_function): Likewise.
gcc/fortran
	* trans-io.c (set_error_locus): Remove old location code.
	* trans-decl.c (gfc_set_decl_location): Remove old location code.
	* f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
	* scanner.c (gfc_gobble_whitespace): Remove old location code.
	(get_file): Likewise.
	(preprocessor_line): Likewise.
	(load_file): Likewise.
	(gfc_new_file): Likewise.
	* trans.c (gfc_trans_runtime_check): Remove old location code.
	(gfc_get_backend_locus): Likewise.
	(gfc_set_backend_locus): Likewise.
	* data.c (gfc_assign_data_value): Remove old location code.
	* error.c (show_locus): Remove old location code.
	* gfortran.h (gfc_linebuf): Remove old location code.
	(gfc_linebuf_linenum): Remove old-location variant.
gcc/java
	* lang.c (java_post_options): Remove conditional.
	* expr.c (expand_byte_code): Remove old location code.
	* jcf-parse.c (set_source_filename): Remove old location code.
	(give_name_to_class): Likewise.
	(jcf_parse): Likewise.
	(duplicate_class_warning): Likewise.
	(parse_class_file): Likewise.
	(java_parse_file): Likewise.
	* decl.c (finish_method): Remove old location code.
	* class.c (push_class): Remove old location code.
gcc/objc
	* objc-act.c (objc_init): Remove old location code.
gcc/treelang
	* tree1.c (treelang_init): Remove old location code.
	(treelang_parse_file): Likewise.
	* lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove.
	(update_lineno_charno): Remove old location code.

From-SVN: r132679
2008-02-26 16:05:24 +00:00
Jakub Jelinek c94ed7a1ae builtins.c (expand_builtin, [...]): Use new %K format string specifier for diagnostics.
* builtins.c (expand_builtin, expand_builtin_object_size,
	expand_builtin_memory_chk, maybe_emit_chk_warning,
	maybe_emit_sprintf_chk_warning): Use new %K format string specifier
	for diagnostics.
	* expr.c (expand_expr_real_1): Likewise.
	* langhooks-def.h (struct diagnostic_info): Add forward decl.
	(lhd_print_error_function): Add third argument.
	* langhooks.h (struct diagnostic_info): Add forward decl.
	(struct lang_hooks): Add third argument to print_error_function.
	* diagnostic.h (diagnostic_info): Add abstract_origin field.
	(diagnostic_last_function_changed, diagnostic_set_last_function): Add
	second argument.
	(diagnostic_report_current_function): Likewise.
	* toplev.c (announce_function): Pass NULL as second argument to
	diagnostic_set_last_function.
	* diagnostic.c (diagnostic_report_current_function): Add second
	argument, pass it as third argument to lang_hooks.print_error_function.
	(default_diagnostic_starter): Pass DIAGNOSTIC as second argument
	to diagnostic_report_current_function.
	(diagnostic_report_diagnostic): Initialize diagnostic->abstract_origin
	and message.abstract_origin.
	(verbatim): Initialize abstract_origin.
	* pretty-print.h (text_info): Add abstract_origin field.
	* pretty-print.c (pp_base_format): Handle %K.
	* langhooks.c (lhd_print_error_function): Add third argument.  If
	diagnostic->abstract_origin, print virtual backtrace.
	* c-format.c (gcc_diag_char_table, gcc_tdiag_char_table,
	gcc_cdiag_char_table, gcc_cxxdiag_char_table): Support %K.
	(init_dynamic_diag_info): Likewise.
cp/
	* error.c (cxx_print_error_function): Add third argument, pass
	it over to lhd_print_error_function.
	(cp_print_error_function): If diagnostic->abstract_origin, print
	virtual backtrace.
	* cp-tree.h (struct diagnostic_info): New forward decl.
	(cxx_print_error_function): Add third argument.
java/
	* lang.c (java_print_error_function): Add third argument.
testsuite/
	* lib/prune.exp: Prune also "^In function .*$" lines and
	"^    inlined from .*$" lines.

From-SVN: r128830
2007-09-27 09:24:58 +02:00
Nick Clifton 9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Manuel López-Ibáñez 4e2bae26bf re PR other/30824 (-Werror -Wfatal-errors should stop after the first warning)
2007-02-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
            DJ Delorie <dj@redhat.com>

	PR other/30824
	* diagnostic.c (diagnostic_count_diagnostic): Move -Werror
	logic to...
	(diagnostic_report_diagnostic): ... here, and turn them into
	real errors. If warnings are inhibited, no need to do
	anything.

testsuite/
	* gcc.dg/Wfatal.c: New.
	* gcc.dg/Wfatal-2.c: New.
	* gcc.dg/Werror-1.c: Adjust expectations.
	* gcc.dg/Werror-5.c: Likewise.
	* gcc.dg/Werror-7.c: Likewise.
	* gcc.dg/Werror-10.c: Likewise.
	* gcc.dg/Werror-11.c: Likewise.

Co-Authored-By: DJ Delorie <dj@redhat.com>

From-SVN: r122159
2007-02-20 10:18:58 +00:00
Volker Reichelt ddaf3b8666 re PR driver/22600 (Exit code should be different from 1 for internal compiler error)
PR driver/22600	
	* system.h (ICE_EXIT_CODE): New macro.
	* diagnostic.c (diagnostic_count_diagnostic): Exit with ICE_EXIT_CODE.
	(diagnostic_action_after_output): Likewise.
	* gcc.c (fatal_ice): New function.
	(execute): Use it instead of fatal.
	(fancy_abort): Likewise.
	* doc/invoke.texi (-pass-exit-codes): Document return code for ICEs.

	* fortran/error.c (gfc_fatal_error): Return ICE_EXIT_CODE instead of 4.

From-SVN: r112292
2006-03-22 19:36:22 +00:00
Kazu Hirata c0220ea4c5 builtins.c, [...]: Fix comment typos.
* builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c,
	combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c,
	config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c,
	config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c,
	df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c,
	loop-invariant.c, omp-low.c, opts.c, passes.c,
	rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c,
	tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c,
	tree-ssa-threadupdate.c, tree-vect-patterns.c,
	tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c,
	unwind-dw2.c: Fix comment typos.  Follow spelling conventions.

From-SVN: r111721
2006-03-04 23:05:24 +00:00
Marcin Dalecki 5ed6ace578 tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31  Marcin Dalecki  <martin@dalecki.de>

	* tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
	* regrename.c: Ditto.
	* tree-ssa-loop-im.c: Ditto.
	* tree-dump.c: Ditto.
	* tree-complex.c: Ditto.
	* genrecog.c: Ditto.
	* tree-ssa-threadupdate.c: Ditto.
	* tracer.c: Ditto.
	* java/class.c: Ditto.
	* java/jcf-parse.c: Ditto.
	* java/resource.c: Ditto.
	* java/except.c: Ditto.
	* java/jvspec.c: Ditto.
	* java/jcf-write.c: Ditto.
	* java/jcf-path.c: Ditto.
	* java/gjavah.c: Ditto.
	* java/zextract.c: Ditto.
	* java/jcf-io.c: Ditto.
	* java/jcf.h: Ditto.
	* java/buffer.c: Ditto.
	* java/lang.c: Ditto.
	* java/parse-scan.y: Ditto.
	* java/lex.c: Ditto.
	* java/lex.h: Ditto.
	* cfgloopmanip.c: Ditto.
	* postreload-gcse.c: Ditto.
	* tree-ssa-loop-manip.c: Ditto.
	* postreload.c: Ditto.
	* tree-ssa-loop-ch.c: Ditto.
	* loop.c: Ditto.
	* ipa-cp.c: Ditto.
	* cppspec.c: Ditto.
	* diagnostic.c: Ditto.
	* final.c: Ditto.
	* genoutput.c: Ditto.
	* gcc.c: Ditto.
	* cfghooks.c: Ditto.
	* cfgloopanal.c: Ditto.
	* objc/objc-act.c: Ditto.
	* gcov.c: Ditto.
	* genextract.c: Ditto.
	* genautomata.c: Ditto.
	* pretty-print.c: Ditto.
	* genemit.c: Ditto.
	* cgraphunit.c: Ditto.
	* flow.c: Ditto.
	* df-scan.c: Ditto.
	* haifa-sched.c: Ditto.
	* dominance.c: Ditto.
	* dbxout.c: Ditto.
	* tree-ssa-loop-ivopts.c: Ditto.
	* df-core.c: Ditto.
	* mode-switching.c: Ditto.
	* modulo-sched.c: Ditto.
	* graph.c: Ditto.
	* ipa-pure-const.c: Ditto.
	* cse.c: Ditto.
	* fix-header.c: Ditto.
	* web.c: Ditto.
	* tree-stdarg.c: Ditto.
	* ipa-utils.c: Ditto.
	* loop-init.c: Ditto.
	* ipa-inline.c: Ditto.
	* cfganal.c: Ditto.
	* global.c: Ditto.
	* alloc-pool.c: Ditto.
	* dwarf2out.c: Ditto.
	* opts.c: Ditto.
	* genattrtab.c: Ditto.
	* tree-ssa-loop-ivcanon.c: Ditto.
	* predict.c: Ditto.
	* timevar.c: Ditto.
	* lcm.c: Ditto.
	* fortran/gfortranspec.c: Ditto.
	* regmove.c: Ditto.
	* local-alloc.c: Ditto.
	* langhooks.c: Ditto.
	* function.c: Ditto.
	* tree-vectorizer.c: Ditto.
	* gcse.c: Ditto.
	* ipa-type-escape.c: Ditto.
	* alias.c: Ditto.
	* tree-if-conv.c: Ditto.
	* profile.c: Ditto.
	* ipa.c: Ditto.
	* tree-data-ref.c: Ditto.
	* loop-unroll.c: Ditto.
	* treelang/treetree.c: Ditto.
	* calls.c: Ditto.
	* bt-load.c: Ditto.
	* ggc-common.c: Ditto.
	* except.c: Ditto.
	* coverage.c: Ditto.
	* cselib.c: Ditto.
	* tree-cfgcleanup.c: Ditto.
	* tree-ssa-pre.c: Ditto.
	* cfgcleanup.c: Ditto.
	* loop-invariant.c: Ditto.
	* loop-iv.c: Ditto.
	* ipa-prop.c: Ditto.
	* print-tree.c: Ditto.
	* conflict.c: Ditto.
	* ggc-page.c: Ditto.
	* sched-deps.c: Ditto.
	* regclass.c: Ditto.
	* tree-object-size.c: Ditto.
	* combine.c: Ditto.
	* bb-reorder.c: Ditto.
	* resource.c: Ditto.
	* var-tracking.c: Ditto.
	* cfgloop.c: Ditto.
	* df-problems.c: Ditto.
	* reg-stack.c: Ditto.
	* tlink.c: Ditto.
	* gccspec.c: Ditto.
	* sched-rgn.c: Ditto.
	* tree-ssa-structalias.c: Ditto.
	* tree-ssa-reassoc.c: Ditto.
	* config/darwin-c.c: Ditto.
	* config/darwin.c: Ditto.
	* config/arm/arm.c: Ditto.
	* cfgrtl.c: Ditto.
	* collect2.c: Ditto.
	* reload1.c: Ditto.

From-SVN: r110446
2006-01-31 20:56:55 +01:00
DJ Delorie 79cf599406 c-pragma.c (handle_pragma_diagnostic): New.
* c-pragma.c (handle_pragma_diagnostic): New.
(init_pragma): Register it.
* doc/extend.texi: Document it.

* diagnostic.def: Add DK_UNSPECIFIED and DK_IGNORED.
* diagnostic.h (diagnostic_classify_diagnostic): Declare.
(diagnostic_context): Add classify_diagnostic[].
* diagnostic.c (diagnostic_count_diagnostic): Don't count warnings
as errors if they're overridden to DK_WARNING.
(diagnostic_initialize): Initialize classify_diagnostic[].
(diagnostic_set_kind_override): New.
(diagnostic_report_diagnostic): Check for kind changes.
* opts.c (common_handle_option): Take lang_mask.  Update callers.
Handle OPT_Werror_.
* common.opt (Werror=): New.
* doc/invoke.texi: Document -Werror=*

From-SVN: r109907
2006-01-18 15:02:42 -05:00
Joseph Myers 178b58b59e re PR c++/17964 (cpp error messages contain wrong line in C++)
gcc:
	PR c++/17964
	* diagnostic.c (diagnostic_set_info_translated): New function.
	(diagnostic_set_info): Use it.  Add comment.
	* diagnostic.h (diagnostic_set_info_translated): Declare.

gcc/cp:
	* error.c (cp_cpp_error): New function.
	* cp-tree.h (cp_cpp_error): Declare.
	* parser.c (cp_lexer_new_main): Set CPP option client_diagnostic
	and error callback after lexing.

gcc/testsuite:
	* g++.dg/cpp/string-1.C: New test.

libcpp:
	* include/cpplib.h (struct cpp_options): Add client_diagnostic.
	(struct cpp_callbacks): Add error.
	* errors.c (cpp_error): If client_diagnostic, use error callback.
	* charset.c (convert_escape): Don't use %03o in diagnostic.

From-SVN: r106454
2005-11-03 23:08:18 +00:00
Andrew Pinski c50367a23c re PR other/22264 (bootstrap broken)
2005-07-01  Andrew Pinski  <pinskia@physics.uc.edu>

        PR other/22264
        * diagnostic.c (diagnostic_report_current_module): Use pp_newline to
        print out the last new line.

From-SVN: r101504
2005-07-01 07:26:18 -07:00
Zack Weinberg 39ce81c9c5 pretty-print.h (PP_NL_ARGMAX): New.
gcc:
	* pretty-print.h (PP_NL_ARGMAX): New.
	(text_info): Add locus.
	(struct chunk_info): New.
	(output_buffer): Add formatted_obstack, chunk_obstack, and
	cur_chunk_array. Change obstack to a pointer.
	(pp_wrapping_mode_t, pp_wrapping_mode, pp_set_verbatim_wrapping): New.
	(struct pretty_print_info): Replace ideal_maximum_length and
	prefixing_rule with wrapping.
	(pp_line_cutoff, pp_prefixing_rule): Update to match.
	Update prototypes and wrapper macros throughout.
	* pretty-print.c (pp_formatted_text_data, pp_append_r)
	(pp_base_clear_output_area, pp_construct, pp_base_formatted_text)
	(pp_base_last_position_in_text, pp_base_newline, pp_base_character):
	Update for changes to pp structure.
	(pp_base_prepare_to_format, pp_base_format_text): Delete.
	(pp_base_format, pp_base_output_formatted_text): New functions.
	(pp_base_format_verbatim): Use pp_set_verbatim_wrapping.
	(pp_verbatim): Clear text.locus.
	(pp_printf): Likewise.  Use pp_format and pp_output_formatted_text.
	* c-objc-common.c (c_tree_printer): Update function signature.
	* diagnostic.c (diagnostic_initialize): Update for changes to
	pp structure.
	(diagnostic_report_diagnostic): Call pp_format and then
	pp_output_formatted_text.
	(verbatim): Clear text.locus.
	* diagnostic.h (diagnostic_prefixing_rule, diagnostic_line_cutoff):
	Update for changes to pp structure.

	* c-lang.c: No need to include c-pretty-print.h.
	* Makefile.in: Remove bogus line containing only a tab.
	(c-lang.o): Update dependencies.
	* toplev.c (announce_function): Don't use verbatim.
	(default_tree_printer): Update signature.

	* objc/objc-lang.c: No need to include c-pretty-print.h.
	* objc/Make-lang.in: Update dependencies.

gcc/cp:
	* cp-lang.c: No need to include cxx-pretty-print.h.
	* error.c (cp_printer): Update signature.  No need to process
	flags.
	(print_instantiation_partial_context): Output last newline
	with pp_base_newline.
	* Make-lang.in: Update dependencies.

gcc/objcp:
	* objcp-lang.c: No need to include cxx-pretty-print.h.
	* Make-lang.in: Update dependencies.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r101481
2005-06-30 23:09:06 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jakub Jelinek 4b794eaf73 exgettext: Handle gmsgid and cmsgid arguments specially, as gcc-internal-format and c-format.
gcc/po/
	* exgettext: Handle gmsgid and cmsgid arguments specially,
	as gcc-internal-format and c-format.  Because of xgettext
	bug, invoke xgettext once with --language=c, once with
	--language=GCC-source and then merge together.  Fail if
	xgettext is not 0.14.5 or later.
gcc/
	* intl.h (G_): New macro.
	* rtl-error.c (error_for_asm, warning_for_asm): Use gmsgid
	instead of msgid for argument name.
	* tree-ssa.c (warn_uninit): Likewise.
	* c-parser.c (c_parser_error): Likewise.
	* config/rs6000/rs6000-c.c (SYNTAX_ERROR): Likewise.
	* config/darwin-c.c (BAD): Likewise.
	* config/c4x/c4x-c.c (BAD): Likewise.
	* c-pragma.c (GCC_BAD, GCC_BAD2): Likewise.
	* c-errors.c (pedwarn_c99, pedwarn_c90): Likewise.
	* c-common.c (c_parse_error): Likewise.
	* diagnostic.c (diagnostic_set_info, verbatim, inform, warning,
	warning0, pedwarn, error, sorry, fatal_error, internal_error):
	Likewise.
	(fnotice): Use cmsgid instead of msgid for argument name.
	* gcov.c (fnotice): Likewise.
	* protoize.c (notice): Likewise.
	* final.c (output_operand_lossage): Likewise.
	* gcc.c (fatal, notice): Likewise.
	(error): Use gmsgid instead of msgid for argument name.
	* collect2.c (notice, fatal_perror, fatal): Use cmsgid instead
	of msgid for argument name.
	(error): Use gmsgid instead of msgid for argument name.
	* c-decl.c (locate_old_decl, implicit_decl_warning): Use G_()
	instead of N_().
	* c-typeck.c (readonly_error, convert_for_assignment): Likewise.
	* tree-inline.c (inline_forbidden_p_1): Likewise.
	* ABOUT-GCC-NLS: Require gettext 0.14.5 or later.  Mention the new
	conventions for marking translations.
	* doc/install.texi: Mention gettext 0.14.5 or later requirement.
gcc/cp/
	* error.c (locate_error): Use gmsgid instead of msgid for argument
	name.
	(cp_error_at, cp_warning_at, cp_pedwarn_at): Likewise.
gcc/java/
	* jv-scan.c (fatal_error, warning, warning0): Use gmsgid instead of
	msgid for argument name.
	* gjavah.c (error): Likewise.
	* java-tree.h (parse_error_context): Likewise.
	* parse.y (parse_error_context, parse_warning_context,
	issue_warning_error_from_context): Likewise.

From-SVN: r100676
2005-06-06 21:31:40 +02:00
DJ Delorie 2098fe9ed5 common.opt (fdiagnostics-show-option): No variable is needed.
* common.opt (fdiagnostics-show-option): No variable is needed.
* diagnostic.h (diagnostic_context): Add show_option_requested flag.
* diagnostic.c (diagnostic_initialize): Initialize show_option_requested.
(diagnostic_report_diagnostic): Test for enabled diagnostics here.
Save and restore original message format.  Use flag in context
instead of global.
(warning): Don't test for enabled warnings here.
* opts.c (common_handle_option): Handle -fdiagnostics-show-option
here.

From-SVN: r99204
2005-05-03 21:36:13 -04:00
DJ Delorie ccf08a6ed7 c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery decide if the warning will be printed.
* c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery
decide if the warning will be printed.
* calls.c (expand_call): Likewise.
* function.c (init-function_start): Likewise.

* common.opt (-fdiagnostics-show-option): New.
* opts.c (option_enabled): Accept the option index instead of a
pointer to the option descriptor.
* opts.h (option_enabled): Likewise.
* toplev.c (print_switch_values): Pass option index, not option
descriptor.
* diagnostic.h (diagnostic_info): Add option_index.
* diagnostic.c: Include opts.h.
(diagnostic_set_info): Initialize option_index.
(diagnostic_report_diagnostic): Amend option name if appropriate.
(warning): Check to see if the specified warning is enabled.
Store option index.
* doc/invoke.texi (-fdiagnostics-show-options): Document.

From-SVN: r99169
2005-05-03 13:55:46 -04:00
DJ Delorie d4ee4d2525 diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.

* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.

* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.

* ada/misc.c: Adjust warning() callers.

* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.

* fortran/trans-decl.c: Adjust warning() callers.

* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.

* objc/objc-act.c: Adjust warning() callers.

* treelang/parse.y: Adjust warning() callers.

From-SVN: r98633
2005-04-23 17:29:07 -04:00
Per Bothner 8abb6b2217 Make -f[no-]show-column also control non-cpp diagnostics.
* c.opt (fshow-column): Move option from here ...
	* common.opt (fshow-column): ... to here.
	* diagnostic.c (diagnostic_build_prefix): Only print column number
	if flag_show_column.

From-SVN: r97127
2005-03-28 00:04:41 -08:00
Per Bothner 255508ddad diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION and we have a non-zero column-number, add it to the message.
* diagnostic.c (diagnostic_build_prefix): If USE_MAPPED_LOCATION
	and we have a non-zero column-number, add it to the message.
	Also factor out the diagnostic_kind_text.

From-SVN: r95746
2005-03-01 08:37:45 -08:00
Kazu Hirata 17385e0d3b cfgcleanup.c, [...]: Update copyright.
* cfgcleanup.c, df.h, diagnostic.c, rtl.c, tree-vectorizer.h,
	config/darwin7.h, config/mips/mips.c,
	config/rs6000/altivec.md, config/rs6000/darwin-tramp.asm:
	Update copyright.

From-SVN: r94704
2005-02-07 15:53:36 +00:00
Marcin Dalecki cbd13f8a73 * diagnostic.c (default_diagnostic_finalizer): Fix use of attribute.
From-SVN: r94671
2005-02-06 10:56:46 +00:00
Ben Elliston ef9af07733 re PR other/17900 (GCC's source path in ICE is wrong)
PR other/17900
	* diagnostic.c (trim_filename): Fix logic bug in walking backwards
	up the filename looking for a previous directory separator.

From-SVN: r89029
2004-10-14 17:15:37 +10:00
Zack Weinberg d5706a1eea pretty-print.c: Include tree.h.
* pretty-print.c: Include tree.h.
	(pp_base_prepare_to_format): New function, logic from
	text_specifies_location.
	(pp_base_format_text): Use gcc_assert.
	* pretty-print.h (pp_prepare_to_format): New macro.
	(pp_base_prepare_to_format): Prototype.
	* diagnostic.c (text_specifies_location): Delete.
	(bug_report_request): Delete.
	(diagnostic_set_info): Don't call text_specifies_location.
	(diagnostic_action_after_output): Put text from
	bug_report_request inline here.  Use gcc_unreachable.
	(diagnostic_report_current_function): Fix comment.
	(diagnostic_report_diagnostic): Clarify logic for error recursion.
	Call pp_prepare_to_format before diagnostic_starter.
	(trim_filename): Use IS_DIR_SEPARATOR.
	(fatal_error, internal_error): Use gcc_unreachable.
	(error_recursion): Call diagnostic_action_after_output to
	issue the bug_report_request message and exit.
	* Makefile.in (diagnostic.o, pretty-print.o): Update dependencies.

	* c-parse.in: Add list of diagnostic messages to insulate
	translation template from version of yacc/bison used to
	compile the grammar.
java:
	* parse.y, parse-scan.y: Add list of diagnostic messages to
	insulate translation template from version of yacc/bison used
	to compile the grammar.
treelang:
	* parse.y: Add list of diagnostic messages to insulate
	translation template from version of yacc/bison used to
	compile the grammar.
po:
	* gcc.pot: Regenerate.

From-SVN: r88590
2004-10-06 04:47:42 +00:00
Nathan Sidwell ced3f397be dbxout.c (dbxout_type, [...]): Use gcc_assert and gcc_unreachable.
* dbxout.c (dbxout_type, dbxout_type_name, dbxout_symbol): Use
	gcc_assert and gcc_unreachable.
	* ddg.c (create_ddg_dependence, add_deps_for_def,
	add_deps_for_use, create_ddg, add_edge_to_ddg): Likewise.
	* df.c (df_ref_unlink, df_ref_record, df_uses_record,
	df_reg_def_chain_create, df_reg_use_chain_create, df_analyze,
	df_insn_delete, df_refs_reg_replace, df_ref_reg_replace,
	df_insns_modify, df_pattern_emit_before, df_bb_reg_live_start_p,
	df_bb_reg_live_end_p, df_bb_regs_lives_compare,
	df_bb_single_def_use_insn_find, dataflow_set_a_op_b,
	dataflow_set_copy, hybrid_search, diagnostic.c,
	diagnostic_build_prefix, diagnostic_count_diagnostic): Likewise.
	* dojump.c (do_jump): Likewise.
	* dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree,
	compute_dom_fast_query, calculate_dominance_info,
	free_dominance_info, get_immediate_dominator,
	set_immediate_dominator, get_dominated_by,
	redirect_immediate_dominators, nearest_common_dominator,
	dominated_by_p, verify_dominators, recount_dominator,
	iterate_fix_dominators, add_to_dominance_info,
	delete_from_dominance_info): Likewise.
	* dwarf2asm.c (size_of_encoded_value, eh_data_format_name,
	dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
	dw2_force_const_mem, dw2_asm_output_encoded_addr_rtx): Likewise.
	* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes, reg_save,
	initial_return_save, stack_adjust_offset, dwarf2out_stack_adjust,
	flush_queued_reg_saves, dwarf2out_frame_debug_expr,
	dwarf2out_frame_debug, dw_cfi_oprnd1_desc, output_cfi,
	output_call_frame_info, output_loc_operands, build_cfa_loc,
	decl_ultimate_origin, AT_flag, AT_int, AT_unsigned, AT_string,
	AT_string_form, add_AT_specification, AT_ref, set_AT_ref_external,
	AT_loc, AT_loc_list, AT_addr, AT_lbl, add_child_die,
	splice_child_die, attr_checksum, same_dw_val_p,
	break_out_includes, build_abbrev_table, size_of_die, mark_dies,
	unmark_dies, value_format, output_loc_list, output_die,
	output_pubnames, output_aranges, base_type_die, is_base_type,
	modified_type_die, dbx_reg_number, multiple_reg_loc_descriptor,
	mem_loc_descriptor, loc_descriptor, loc_descriptor_from_tree_1,
	field_byte_offset, add_data_member_location_attribute,
	add_const_value_attribute, rtl_for_decl_location,
	add_location_or_const_value_attribute, add_byte_size_attribute,
	add_bit_offset_attribute, add_bit_size_attribute,
	add_abstract_origin_attribute, pop_decl_scope, scope_die_for,
	decl_start_label, gen_formal_parameter_die,
	gen_type_die_for_member, gen_subprogram_die, gen_label_die,
	gen_typedef_die, gen_type_die, gen_tagged_type_instantiation_die,
	force_decl_die, force_type_die, gen_decl_die,
	dwarf2out_imported_module_or_decl, prune_unused_types_prune,
	dwarf2out_finish): Likewise.

From-SVN: r87176
2004-09-08 07:47:45 +00:00
Gabriel Dos Reis 7783b40203 c-opts.c (c_common_handle_option): <case OPT_Werror> set global_dc->warning_as_error_requested.
* c-opts.c (c_common_handle_option): <case OPT_Werror> set
        global_dc->warning_as_error_requested.
        * diagnostic.c (diagnostic_initialize): Tidy.
        * diagnostic.h (diagnostic_context::x_data): Remove
        (diagnostic_context::issue_warnings_are_errors_message): Rename
        from warnings_are_errors_message.
        (diagnostic_context::warning_as_error_requested): New.

From-SVN: r86750
2004-08-30 04:48:34 +00:00
Per Bothner 6773e15fa5 Conditionally compile support for --enable-mapped_location.
* cfgexpand.c:  Handle USE_MAPPED_LOCATION case for function_end_locus.
	* cfglayout.c (insn_locators_initialize):  Const cleanup.  New macros.
	* cfgrtl.c (delete_insn):  Use new NOTE_DELETED_LABEL_NAME macro.
	* print-rtl.c (print_rtx):  Likewise.
	* emit-rtl.c:  Don't clear NOTE_SOURCE_FILE if USE_MAPPED_LOCATION.
	* combine.c:  Use new SET_INSN_DELETED macro.
	* flow.c:  Likewise.
	* haifa-sched.c:  Likewise.
	* ifcvt.c:  Likewise.
	* recog.c:  Likewise.
	* reload1.c:  Likewise.
	* diagnostic.c:  Use expand_location macro.
	* pretty-print.c (pp_base_format_text):  Likewise.
	* profile.c:  Likewise.
 	* dwarf2out.c:  Likewise.  Also use expand_location, DECL_IS_BUILTIN.
 	* dwarf2out.c (dwarf2out_decl:  Use BUILTINS_LOCATION.
	* emit-rtl.c (emit_line_note):  Simplify if USE_MAPPED_LOCATION.
	(force_next_line_note, insn_emit):  Handle USE_MAPPED_LOCATION case.
	* final.c (final):  Likewise.
	* haifa-sched.c:  Likewise.
	* integrate.c:  Likewise.
	* jump.c:  Likewise.
	* rtl-error.c:  Likewise.
	* stmt.c (check_seenlabel):  Likewise.
	* tree-pretty-print.c:  Likewise.

From-SVN: r83921
2004-06-30 11:18:01 -07:00
Zdenek Dvorak 50431bc428 Makefile.in (FLAGS_H): New.
* Makefile.in (FLAGS_H): New.
	(flags.h): Replace by FLAGS_H.
	* c.opt: Document Var, VarExists, Init and Report attributes.
	* common.opt: Fill the values of the attributes.
	* diagnostic.c (flag_fatal_errors): Do not define.
	* except.c (flag_non_call_exceptions): Do not define.
	* flags.h: Include options.h.  Remove declarations conflicting with
	the automatically defined ones.
	* opts.c: Remove automatically defined variables.
	(handle_option): Perform default initialization.
	(common_handle_option): Do not handle options covered by the
	default initialization.
	* opts.h (struct cl_option): Add flag_var, has_set_value and set_value
	fields.
	(CL_REPORT): New.
	* opts.sh: Generate variable declarations, handle CL_REPORT.
	* toplev.c: Remove automatically defined variables.
	(f_options): Removed.
	(print_switch_values): Use cl_options instead of f_options.
	* toplev.h (version_flag): Declaration removed.

From-SVN: r83105
2004-06-14 14:18:01 +00:00
Mark G. Adams a757585a22 tree.h: Remove include of version.h
* tree.h: Remove include of version.h
	* c-cppbuiltin.c: Include version.h
	* diagnostic.c: Include version.h
	* dwarf2out.c: Include version.h
	* toplev.c: Include version.h
	* vmsdbgout.c: Include version.h
	* Makefile.in: Remove dependency on version.h from TREE_H, and
	add dependencies to required .o targets
	* gjavah.c: Include version.h

From-SVN: r82601
2004-06-03 18:48:28 +00:00
Richard Guenther c65a01af06 Patch from Richard Guenther.
* commom.opt (Wfatal-errors): Add it.
* diagnostic.c (flag_fatal_errors): Define it.
(diagnostic_action_after_output): Check for flag_fatal_errors.
* flags.h (flag_fatal_errors): Declare it.
* opts.c (common_handle_option): Add OPT_Wfatal_errors.
* doc/invoke.texi (Warning Options): Document -Wfatal-errors.

From-SVN: r81323
2004-04-29 22:29:23 -07:00
Roger Sayle ae2bcd98fa alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) () with lang_hooks.foo ().
* alias.c (get_alias_set): Replace calls via (*lang_hooks.foo) ()
	with lang_hooks.foo ().
	* builtins.c (expand_builtin_va_arg): Likewise.
	* c-common.c (fname_as_string, c_common_truthvalue_conversion,
	c_common_type_for_mode, c_common_nodes_and_builtins,
	handle_mode_attribute, handle_vector_size_attribute): Likewise.
	* c-convert.c (convert): Likewise.
	* c-format.c (check_format_types): Likewise.
	* c-objc-common.c (c_tree_printer): Likewise.
	* c-typeck.c (build_unary_op, build_conditional_expr,
	build_binary_op): Likewise.
	* calls.c (try_to_integrate, expand_call,
	emit_library_call_value_1): Likewise.
	* cgraph.c (cgraph_node_name, cgraph_function_possibly_inlined_p):
	Likewise.
	* cgraphunit.c (record_call_1, cgraph_analyze_function,
	cgraph_expand_function): Likewise.
	* convert.c (convert_to_pointer, convert_to_integer): Likewise.
	* coverage.c (build_fn_info_type, build_ctr_info_type,
	build_gcov_info, create_coverage): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* diagnostic.c (diagnostic_report_current_function): Likewise.
	* dojump.c (do_jump): Likewise.
	* dwarf2out.c (dwarf2_name): Likewise.
	* except.c (init_eh): Likewise.
	* explow.c (expr_size, int_expr_size): Likewise.
	* expmed.c (make_tree, const_mult_add_overflow_p, expand_mult_add):
	Likewise.
	* expr.c (store_expr, store_constructor, safe_from_p,
	expand_expr_real, do_store_flag, try_casesi): Likewise.
	* function.c (push_function_context_to, pop_function_context_from,
	free_after_parsing, assign_stack_local_1, assign_stack_temp_for_type,
	put_var_into_stack, allocate_struct_function, current_function_name):
	Likewise.
	* integrate.c (copy_decl_for_inlining, expand_inline_function):
	Likewise.
	* langhooks.c (lhd_clear_binding_stack, write_global_declarations,
	lhd_print_error_function): Likewise.
	* opts.c (handle_option, decode_options): Likewise.
	* passes.c (open_dump_file): Likewise.
	* print-tree.c (print_node): Likewise.
	* stmt.c (expand_fixup, fixup_gotos, expand_asm_operands,
	expand_decl_cleanup, emit_case_nodes): Likewise.
	* stor-layout.c (variable_size): Likewise.
	* toplev.c (announce_function, wrapup_global_declarations,
	check_global_declarations, compile_file, default_tree_printer,
	process_options, lang_dependent_init, finalize): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-inline.c (remap_decl, remap_block, copy_body_r,
	initialize_inlined_parameters, declare_return_variable,
	inlinable_function_p, expand_call_inline, optimize_inline_calls,
	walk_tree, copy_tree_r): Likewise.
	* tree-optimize.c (tree_rest_of_compilation): Likewise.
	* tree.c (decl_assembler_name, tree_size, size_in_bytes, staticp,
	unsafe_for_reeval, get_unwidened, get_narrower, get_callee_fndecl,
	variably_modified_type_p, dump_tree_statistics): Likewise.
	* varasm.c (assemble_variable, compare_constant, copy_constant,
	force_const_mem, compute_reloc_for_constant, output_constant,
	output_addressed_constants, initializer_constant_valid_p): Likewise.

From-SVN: r79481
2004-03-14 22:26:14 +00:00
Kazu Hirata 88462c42d2 bb-reorder.c, [...]: Update copyright.
gcc/
	* bb-reorder.c, cfgbuild.c, diagnostic.c, explow.c, profile.c,
	ra-build.c, read-rtl.c, tracer.c, unwind-dw2-fde-glibc.c,
	value-prof.c, config/darwin-protos.h, config/frv/frv-abi.h,
	config/i386/pmmintrin.h, config/pa/pa-hpux.h: Update
	copyright.

gcc/java/
	* java/parse.h: Update copyright.

From-SVN: r78566
2004-02-27 14:50:47 +00:00
Richard Henderson f6db1481a7 passes.c: New file.
* passes.c: New file.
        * Makefile.in (OBJS-common): Add it.
        * diagnostic.c (rtl_dump_and_exit): Move decl ...
        * flags.h (rtl_dump_and_exit): ... here.
        * output.h (size_directive_output, last_assemble_variable_decl):
        Move from toplev.c.
        * rtl.h (reg_alloc): Move from toplev.c.
        * toplev.c (HAVE_conditional_execution, DUMPFILE_FORMAT,
        struct dump_file_info, enum dump_file_index, dump_file_tbl,
        open_dump_file, close_dump_file, rest_of_decl_compilation,
        rest_of_type_compilation, rest_of_handle_final,
        rest_of_handle_delay_slots, rest_of_handle_stack_regs,
        rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
        rest_of_handle_new_regalloc, rest_of_handle_old_regalloc,
        rest_of_handle_regrename, rest_of_handle_reorder_blocks,
        rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_regmove,
        rest_of_handle_tracer, rest_of_handle_if_conversion,
        rest_of_handle_if_after_combine, rest_of_handle_web,
        rest_of_handle_branch_prob,
        rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
        rest_of_handle_addressof, rest_of_handle_sibling_calls,
        rest_of_handle_jump_bypass, rest_of_handle_inlining,
        rest_of_handle_null_pointer, rest_of_handle_combine,
        rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
        rest_of_handle_gcse, rest_of_handle_loop_optimize,
        rest_of_handle_loop2, rest_of_compilation): Move to passes.c.
        (decode_d_option): Use enable_rtl_dump_file.
        (compile_file, finalize, do_compile): Move profile+combine+graph
        cleanup to finish_optimization_passes.
        * toplev.h (init_optimization_passes, finish_optimization_passes,
        enable_rtl_dump_file): Declare.

From-SVN: r78561
2004-02-27 00:54:31 -08:00
Richard Henderson f31686a322 Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.
From-SVN: r71641
2003-09-21 22:09:32 -07:00
Richard Henderson 7e2af53a14 tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
	(TREE_FILENAME, TREE_LINENO): Likewise.
	(set_tree_locus, copy_tree_locus, set_tree_file_line): New.
	(TREE_LOCUS_SET_P): New.
	* c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
	diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
	print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
	tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
	config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match.

ada/
	* trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

cp/
	* class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
	method.c, optimize.c, pt.c, semantics.c, tree.c: Update for
	DECL_SOURCE_LOCATION rename and change to const.

f/
	* com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

java/
	* class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
	resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.

treelang/
	* treetree.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

From-SVN: r71636
2003-09-21 16:39:40 -07:00
Richard Henderson ddd2d57e72 c-format.c (gcc_diag_char_table): Add %J.
* c-format.c (gcc_diag_char_table): Add %J.
        (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
        (check_format_types): Fix wanted_type name lookup.
        (init_dynamic_diag_info): Setup %J.
        * diagnostic.c (text_specifies_location): Implement %J.
        * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
        dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
        tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
        config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
        config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.

        * tree-inline.c: Include intl.h
        (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
        * Makefile.in (tree-inline.o): Update.
cp/
        * decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
        * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
        * gcc.dg/format/gcc_diag-1.c: Add tests for %J.

From-SVN: r71619
2003-09-20 22:07:20 -07:00
Gabriel Dos Reis 43f9ce0256 * diagnostic.c (warn_deprecated_use): Move to toplev.c
From-SVN: r71168
2003-09-07 11:59:52 +00:00
Gabriel Dos Reis dba65e798f langhooks.c (lhd_print_error_function): Move from diagnostic.c.
* langhooks.c (lhd_print_error_function): Move from diagnostic.c.
	* Makefile.in (langhooks.o): Depend on diagnostic.h

From-SVN: r71165
2003-09-07 10:11:28 +00:00
Gabriel Dos Reis 0761f342c5 * diagnostic.c (announce_function): Move to toplev.c.
From-SVN: r71146
2003-09-06 21:33:46 +00:00
Gabriel Dos Reis b6fe0bb8c5 Remove pedwarn_with_decl, warning_with_decl and error_with_decl from GCC.
Remove pedwarn_with_decl, warning_with_decl and error_with_decl
        from GCC.
        * calls.c (try_to_integrate): Don't use xxx_with_decl.
        (expand_call): Likewise.
        * dwarfout.c (output_reg_number): Likewise.
        * expr.c (expand_expr): Likewise.
        * function.c (assign_temp): Likewise.
        (uninitialized_vars_warning): Likewise.
        (setjmp_args_warning): Likewise.
        (expand_function_end): Likewise.
        * stmt.c (fixup_gotos): Likewise.
        (warn_about_unused_variables): Likewise.
        (expand_end_bindings): Likewise.
        * stor-layout.c (layout_decl): Likewise.
        (place_field): Likewise.
        * toplev.c (check_global_declarations): Likewise.
        (rest_of_handle_inlining): Likewise.
        (default_tree_printer): New function.
        (general_init): Initialize diagnostic machinery before routing
        signals to the ICE machinery.  Set default tree printer.
        * toplev.h (pedwarn_with_decl): Remove declaration.
        (warning_with_decl): Likewise.
        (error_with_decl): Likewise.
        (pedwarn): Remove attribute for the time being.
        * tree-inline.c (expand_call_inline): Don't use xxx_with_decl.
        * varasm.c (named_section): Likewise.
        (make_decl_rtl): Likewise.
        (assemble_variable): Likewise.
        (merge_weak): Likewise.
        (declare_weak): Likewise.

        * diagnostic.h: Move non-diagnostic stuff into pretty-print.h.
        * diagnostic.c: Move non-diagnostic stuff into pretty-print.c.
        (format_with_decl): Remove.
        (diagnostic_for_decl): Likewise.
        (pedwarn_with_decl): Likewise.
        (warning_with_decl): Likewise.
        (error_with_decl): Likewise.
        (diagnostic_initialize): Adjust.
        (diagnostic_count_diagnostic): Likewise.
        (announce_function): Likewise.
        (lhd_print_error_function): Likewise.
        (diagnostic_report_current_module): Likewise.
        (default_diagnostic_starter): Likewise.
        (diagnostic_report_diagnostic): Likewise.
        (default_diagnostic_finalizer): Likewise.
        (verbatim): Likewise.
        (error): Likewise.
        (warning): Likewise.
        * opts.c (common_handle_option): Likewise.
        * pretty-print.c: New file.
        * c-pretty-print.h (pp_base): Override.
        * c-pretty-print.c: Adjust use of macros throughout.
        (pp_buffer): New macro.
        (pp_newline): Likewise.
        * c-objc-common.c (c_tree_printer): Adjust prototype. Tidy.
        * Makefile.in (DIAGNOSTIC_H): New variable.
        (c-errors.o): Use it.
        (c-objc-common.o): Likewise.
        (c-common.o): Likewise.
        (c-opts.o): Likewise.
        (c-format.o): Likewise.
        (diagnostic.o): Likewise.
        (opts.o): Likewise.
        (toplev.o): Likewise.
        (rtl-error.o): Likewise.
        (dwarf2out.o): Likewise.
        (jump.o): Likewise.
        (pretty-print.o): New rule.

cp/
        * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H.
        * error.c: Use the new pretty-printer fraamework.

From-SVN: r69773
2003-07-25 09:52:32 +00:00
Kazu Hirata 938d968ed3 alias.c: Fix comment formatting.
* alias.c: Fix comment formatting.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* combine.c: Likewise.
	* cpplib.c: Likewise.
	* diagnostic.c: Likewise.
	* dojump.c: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* ggc-page.c: Likewise.
	* jump.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* recog.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.

From-SVN: r69689
2003-07-22 23:15:30 +00:00
Per Bothner 53f72d60b6 diagnostic.c. (diagnostic_report_current_module): Update to match 2003-06-05 changes to push_srcloc and pop_srcloc.
* diagnostic.c.(diagnostic_report_current_module):  Update to match
	2003-06-05 changes to push_srcloc and pop_srcloc.

From-SVN: r69687
2003-07-22 16:10:22 -07:00
Gabriel Dos Reis b0e3f7ec30 re PR c++/11531 (ICE on invalid code (returning to void))
PR c++/11531
        * diagnostic.c (diagnostic_report_diagnostic): Don't ICE if we're
        not recursing on hard error.
        (diagnostic_for_decl): Likewise.
        * diagnostic.def: Rearrange.

cp/
        * typeck.c (check_return_expr): Fix thinko in diagnostic.

From-SVN: r69425
2003-07-15 23:31:52 +00:00
Andreas Jaeger 5671bf2771 genextract.c: Convert remaining prototypes to ISO C90.
2003-07-07  Andreas Jaeger  <aj@suse.de>

	* genextract.c: Convert remaining prototypes to ISO C90.

	* cpplex.c (_cpp_free_buff): Convert prototype to ISO C90.
	* fold-const.c (fold_single_bit_test): Likewise.
	* diagnostic.c (default_diagnostic_finalizer): Likewise.
	* cfgrtl.c (rtl_redirect_edge_and_branch): Likewise.

	* gengtype.c (write_array): Generate ISO C90 prototypes.

	* genflags.c (gen_proto): Generate ISO C90 prototypes.


For cp:
2003-07-07  Andreas Jaeger  <aj@suse.de>

	* friend.c: Convert to ISO C90 prototypes.

	* Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output
	language.
	* cfns.h: Regenerate.

	* typeck.c: Convert remaining prototypes to ISO C90.
	* search.c: Likewise.

	* decl2.c (build_expr_from_tree): Convert prototype to ISO C90.
	* semantics.c (expand_or_defer_fn): Likewise
	* mangle.c (discriminator_for_string_literal): Likewise.
	* g++spec.c (lang_specific_driver): Likewise.

	* search.c (lookup_base_r): Remove unused variable.

From-SVN: r69050
2003-07-07 21:11:59 +02:00
Kazu Hirata e0bb17a83f basic-block.h: Fix comment typos.
* basic-block.h: Fix comment typos.
	* bb-reorder.c: Likewise.
	* c-format.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* dbxout.c: Likewise.
	* df.c: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* et-forest.h: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.h: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genautomata.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* ra-build.c: Likewise.
	* ra-colorize.c: Likewise.
	* ra-rewrite.c: Likewise.
	* ra.h: Likewise.
	* regmove.c: Likewise.
	* reload.c: Likewise.
	* rtlanal.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-vis.c: Likewise.
	* sreal.c: Likewise.
	* ssa-ccp.c: Likewise.
	* ssa.c: Likewise.
	* toplev.c: Likewise.
	* tree-inline.c: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.

From-SVN: r68770
2003-07-01 12:18:01 +00:00
Kazu Hirata f9da506452 alloc-pool.c: Fix comment formatting.
* alloc-pool.c: Fix comment formatting.
	* bitmap.c: Likewise.
	* bitmap.h: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* cfganal.c: Likewise.
	* cfgrtl.c: Likewise.
	* collect2.c: Likewise.
	* cse.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* libgcov.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* prefix.c: Likewise.
	* rtlanal.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* toplev.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r68672
2003-06-29 13:53:12 +00:00
Nathan Sidwell 9a472a4224 diagnostic.h (diagnostic_set_info): Replace file and lineno parameters with a location_t.
* diagnostic.h (diagnostic_set_info): Replace file and lineno
	parameters with a location_t.
	* diagnostic.c (diagnostic_set_info): Replace file and lineno
	parameters with a location_t.
	(inform, warning, pedwarn, error, sorry, fatal_error,
	internal_error, warning_with_decl, pedwarn_with_decl,
	error_with_decl): Adjust.
	* c-error.c (pedwarn_c99): Adjust.
	* c-format.c (status_warning): Adjust.
	* rtl-error.c (file_and_line_for_asm): Rename to ...
	(location_for_asm): Return a location_t.
	(diagnostic_for_asm): Adjust.

	* cp/cp-tree.h (cp_line_of, cp_file_of): Remove.
	* cp/error.c (cp_line_of, cp_file_of): Merge into ...
	(location_of): ... here. Make static, return a location_t.
	(cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust.

	* testsuite/g++.old-deja/g++.robertl/eb133.C: Set expected line
	number.
	* testsuite/g++.old-deja/g++.robertl/eb133a.C: Likewise.
	* testsuite/g++.old-deja/g++.robertl/eb133b.C: Likewise.

From-SVN: r68643
2003-06-28 16:23:29 +00:00
Gabriel Dos Reis c707a408ca diagnostic.c (output_integer_with_precision): New macro.
* diagnostic.c (output_integer_with_precision): New macro.
	(output_format): Use it.  Handle more format specifiers.
	(output_long_decimal): Remove.
	(output_unsigned_decimal): Likewise.
	(output_long_unsigned_decimal): Likewise.
	(output_octal): Likewise.
	(output_long_octal): Likewise.
	(output_hexadecimal): Likewise.
	(output_long_hexadecimal): Likewise.
	(output_long_long_decimal): Likewise.

From-SVN: r68638
2003-06-28 13:40:31 +00:00
Kazu Hirata 71c0e7fc96 basic-block.h: Fix comment formatting.
* basic-block.h: Fix comment formatting.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-format.c: Likewise.
	* coverage.c: Likewise.
	* cpplib.h: Likewise.
	* cpppch.c: Likewise.
	* dbxout.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* profile.c: Likewise.
	* real.h: Likewise.
	* sched-deps.c: Likewise.

From-SVN: r68369
2003-06-23 15:27:37 +00:00
Gabriel Dos Reis 0e9e3a8b78 diagnostic.h (output_host_wide_integer): Declare.
* diagnostic.h (output_host_wide_integer): Declare.
	* diagnostic.c (output_long_long_decicaml): New function.
	(output_host_wide_integer): Likewise.
	(output_format): Use them.  Handle "%ll" and "%w".

From-SVN: r68323
2003-06-22 08:05:39 +00:00
Neil Booth e01cc6dc62 c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
* c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
	* common.opt: Add remaining -W options and -g.
	* diagnostic.c (warnings_are_errors): Remove.
	* flags.h: Make most warning flags boolean.
	* opts.c (common_handle_option): Handle remaining -W options, and -g.
	Move many warning flags from toplev.c, making them boolean.
	* toplev.c: Remove many warning flags.
	(decode_W_option): Remove.
	(decode_g_option): Make extern.  Error on unknown switch.
	(lang_independent_W_options): Use warn_dummy.
	(independent_decode_option): Just handle -f switches now.
	* toplev.h (decode_g_option): New.

From-SVN: r68287
2003-06-20 22:56:36 +00:00
Andreas Jaeger 79a490a95b predict.h: Convert to ISO C90 prototypes.
* predict.h: Convert to ISO C90 prototypes.
	* predict.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-dump.c: Likewise.
	* diagnostic.h: Likewise.
	* diagnostic.c: Likewise.
	* combine.c: Likewise.

	* rtl.h: Convert prototypes of combine.c to ISO C90.

From-SVN: r67626
2003-06-08 16:21:54 +02:00
Kaveh R. Ghazi e34d07f255 builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
	* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
	always use stdarg.
	* c-errors.c (pedwarn_c99): Likewise.
	* c-format.c (status_warning): Likewise.
	* c-semantics.c (build_stmt): Likewise.
	* calls.c (emit_library_call, emit_library_call_value): Likewise.
	* collect2.c (notice, fatal_perror, fatal, error): Likewise.
	* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
	* diagnostic.c (build_message_string, output_printf,
	output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
	fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
	error_with_decl, fnotice): Likewise.
	* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
	dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
	dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
	dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
	dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
	dw2_asm_output_encoded_addr_rtx): Likewise.
	* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
	* errors.c (warning, error, fatal, internal_error): Likewise.
	* final.c (output_operand_lossage, asm_fprintf): Likewise.
	* fix-header.c (fatal): Likewise.
	* gcc.c (fatal, error, notice): Likewise.
	* gcov.c (fnotice): Likewise.
	* genattrtab.c (attr_rtx, attr_printf): Likewise.
	* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
	* gensupport.c (message_with_line): Likewise.
	* mips-tfile.c (fatal, error): Likewise.
	* protoize.c (notice): Likewise.
	* ra-debug.c (ra_debug_msg): Likewise.
	* read-rtl.c (fatal_with_file_and_line): Likewise.
	* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
	* tree.c (build, build_nt, build_function_type_list): Likewise.

cp:
	* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
	libiberty VA_ macros, always use stdarg.
	* rtti.c (create_pseudo_type_info): Likewise.
	* tree.c (build_min_nt, build_min): Likewise.

From-SVN: r66919
2003-05-17 22:21:35 +00:00
Zack Weinberg fa6ef81367 diagnostic.c (output_format): Add support for %m.
* diagnostic.c (output_format): Add support for %m.
	(output_printf, output_verbatim, diagnostic_set_info,
	verbatim): Set err_no field of the text_info structure being
	initialized.
	(fatal_io_error): Delete function.
	* diagnostic.h (text_info): Add err_no field.
	* toplev.h (fatal_io_error): Delete prototype.

	* c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
	* toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
	* f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c
	* objc/objc-act.c: Replace all calls to fatal_io_error with
	calls to fatal_error; add ": %m" to the end of all the affected
	error messages.

From-SVN: r66769
2003-05-13 18:06:52 +00:00
Zack Weinberg 9804f5fb8b diagnostic.c (diagnostic_for_decl): Take a diagnostic_context argument.
* diagnostic.c (diagnostic_for_decl): Take a
	diagnostic_context argument.  Restructure to be consistent
	with diagnostic_report_diagnostic.
	(diagnostic_count_diagnostic): Now static.  Take a
	diagnostic_info argument, not just a diagnostic_t.  Some code
	moved here from internal_error.  Move a case label for
	clarity.
	(diagnostic_action_after_output): New function.  Code moved
	here from internal_error and fatal_error.
	(bug_report_request): New #define so that this text appears in
	only one place.
	(diagnostic_report_diagnostic): Update to match changes to
	diagnostic_count_diagnostic.  Call diagnostic_action_after_output.
	(diagnostic_set_info): Call gettext here.

	(pedwarn): Update comment.  Don't call gettext here.
	(sorry): Use report_diagnostic.  Don't call gettext here.
	(fatal_error): Remove final fnotice and exit, but call
	real_abort to prevent warnings about noreturn function returning.
	(internal_error): Likewise.  Don't do ICE suppression here nor
	call context->internal_error.
	(warning_with_decl): Suppress for decls in system headers.
	Adjust call to diagnostic_for_decl.
	(pedwarn_with_decl): Likewise.
	(error_with_decl): Adjust call to diagnostic_for_decl.
	(error_recursion): Use bug_report_request.

	* diagnostic.h: Remove prototype of diagnostic_count_diagnostic.
	* objc/objc-act.c (error_with_ivar, warn_with_method): Don't call
	diagnostic_count_diagnostic.
f:
	* bad.c: Don't call diagnostic_count_diagnostic.

From-SVN: r66728
2003-05-12 18:32:18 +00:00
Zack Weinberg 59650e480e diagnostic.c: Reorder functions for clarity...
* diagnostic.c: Reorder functions for clarity, putting all the
	functions in the "error" family next to each other, and
	likewise all the functions in the "error_with_decl" family.
	Some other routines were moved too.  Add comments.
	(vbuild_message_string): Fold into sole caller.

From-SVN: r66676
2003-05-11 02:06:12 +00:00
Gabriel Dos Reis 3c4b64384b toplev.h (warning_with_file_and_line): Don't declare.
* toplev.h (warning_with_file_and_line): Don't declare.
	(error_with_file_and_line): Likewise.
	* diagnostic.c (error_with_file_and_line): Remove.
	(warning_with_file_and_line): Likewise.

From-SVN: r66628
2003-05-09 10:08:19 +00:00
Gabriel Dos Reis c71f2ffd78 toplev.h (pedwarn_with_file_and_line): Don't declare.
* toplev.h (pedwarn_with_file_and_line): Don't declare.
	* diagnostic.c (pedwarn_with_file_and_line): Remove.

From-SVN: r66456
2003-05-04 15:18:21 +00:00
Wolfgang Bangerth 5ca5a6554e Clarify the comment before the abort we hit when a translated string contains invalid formats.
From-SVN: r66381
2003-05-02 07:34:52 -06:00
Nathan Sidwell 6060edcbe2 Makefile.in (TREE_H): Replace location.h with input.h.
* Makefile.in (TREE_H): Replace location.h with input.h.
	(GTFILES) Remove location.h
	(gt-lists.h): Replace gt-location.h with gt-input.h
	* input.h (input_filename, input_line): Remove variables.
	(location_s, location_t): Move from location.h.
	(input_location): New.
	(input_filename, input_line): New #defines.
	* location.h: Remove.
	* tree.h: Replace location.h with input.h.
	(input_filename, input_line): Remove.
	* diagnostic.h: Replace location.h with input.h.
	* gcc.h (input_filename, input_filename_length): Remove declarations.
	* toplev.c (input_filename, input_line): Remove.
	(input_location): Define.
	(push_srcloc, pop_srcloc): Adjust.
	* diagnostic.c (diagnostic_report_current_module): Adjust.
f:
	* lex.c (ffelex_file_pop_): Adjust file_stack member use.
	(ffelex_file_push_): Likewise.
	(ffelex_hash_): Likewise.
java:
	* lex.h (input_lineno): Remove declaration.
	* parse-scan.y: #include input.h.
	(input_filename): Remove declaration.
	(input_location): Add definition.
	(input_line): Remove definition.

From-SVN: r66378
2003-05-02 11:33:06 +00:00
Nathan Sidwell d479d37f5e input.h (lineno): Rename to ...
* input.h (lineno): Rename to ...
	(input_line): ... here.
	* tree.h (lineno): Rename to ...
	(input_line): ... here.
	* scan.h (lineno): Rename to ...
	(input_line): ... here.
	* toplev.c (lineno): Rename to ...
	(input_line): ... here.
	(push_srcloc, pop_srcloc):  Rename lineno to input_line.
	* c-common.c (c_expand_start_cond, fname_decl): Likewise.
	* c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag,
	store_parm_decls, c_expand_body_1): Likewise.
	* c-errors.c (pedwarn_c99): Likewise.
	* c-format.c (status_warning): Likewise.
	* c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise.
	* c-opts.c (c_common_post_options, c_common_parse_file): Likewise.
	* c-parse.in (save_filename, maybe_type_qual, ifc): Likwise.
	* c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var,
	gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt,
	genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt,
	genrtl_return_stmt, genrtl_for_stmt, build_break_stmt,
	build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt,
	prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise.
	* coverage.c (create_coverage): Likewise.
	* diagnostic.c (pedwarn, sorry, error, fatal_error,
	internal_error, warning, diagnostic_report_current_module,
	inform): Likewise.
	* expr.c (expand_expr): Likewise.
	* integrate.c (expand_inline_function,
	output_inline_function): Likewise.
	* rtl-error.c (file_and_line_for_asm): Likewise.
	* tree-inline.c (find_alloca_call, find_builtin_longjmp_call,
	walk_tree): Likewise.
	* tree.c (make_node): Likewise.
	* ada, cp, f, java, objc, treelang: Likewise.

	ada
	* trans.c (build_unit_elab, set_lineno): Rename lineno to
	input_line.
	* utils.c (pushdecl, create_label_decl, begin_subprog_body,
	end_subprog_body): Likewise.
	* utils2.c (build_call_raise): Likewise.

	cp
	* class.c (finish_struct): Rename lineno to input_line.
	* decl.c (push_binding_level, pop_binding_level,
	suspend_binding_level, resume_binding_level, make_label_decl,
	use_label, start_function): Likewise.
	* decl2.c (warn_if_unknown_interface,
	start_static_initialization_or_destruction,
	generate_ctor_or_dtor_function, finish_file): Likewise.
	* error.c (cp_line_of, print_instantiation_full_context,
	print_instantiation_context): Likewise.
	* except.c (check_handlers_1, check_handlers): Likewise.
	* init.c (create_temporary_var): Likewise.
	* method.c (use_thunk, synthesize_method): Likewise.
	* parser.c (cp_lexer_set_source_position_from_token,
	cp_lexer_get_preprocessor_token): Likewise.
	* pt.c (push_tinst_level, pop_tinst_level,
	tsubst_friend_function, instantiate_class_template, tsubst_decl,
	tsubst, tsubst_expr, instantiate_decl): Likewise.
	* semantics.c (genrtl_try_block, finish_label_stmt,
	begin_class_definition, expand_body,
	genrtl_finish_function): Likewise.
	* tree.c (build_min_nt, build_min): Likewise.

	f
	* ansify.c (die_unless): Rename lineno to input_line.
	* com.c (ffecom_subscript_check_, ffecom_do_entry_,
	ffecom_gen_sfuncdef_, ffecom_start_progunit_,
	ffecom_sym_transform_, ffecom_sym_transform_assign_,
	bison_rule_pushlevel_, bison_rule_compstmt_, finish_function,
	store_parm_decls): Likewise.
	* intrin.c (ffeintrin_fulfill_generic): Likewise.
	* lex.c (ffelex_hash_, ffelex_include_, ffelex_next_line_,
	ffelex_file_fixed, ffelex_file_free): Likewise.
	* std.c (ffestd_exec_end): Likewise.
	* ste.c (ffeste_emit_line_note_, ffeste_start_block_,
	ffeste_start_stmt_): Likewise.
	* ste.h (ffeste_filelinenum, ffeste_set_line): Likewise.

	java
	* lex.h (lineno): Rename to ...
	(input_line): ... here
	* parse-scan.y (lineno): Rename to ...
	(input_line): ... here.
	(reset_report): Rename lineno to input_line.
	* check-init.c (check_init): Likewise.
	* class.c (push_class): Likewise.
	* decl.c (complete_start_java_method, end_java_method): Likewise.
	* expr.c (expand_byte_code): Likewise.
	* jcf-parse.c (give_name_to_class, parse_class_file): Likewise.
	* jcf-write.c (generate_bytecode_insns): Likewise.
	* lex.c (java_init_lex, java_allocate_new_line,
	do_java_lex): Likewise.
	* parse.h (YYNOT_TWICE): Likewise.
	* parse.y (empty_statement, expression_statement,
	java_pop_parser_context, java_parser_context_save_global,
	yyerror, register_fields, method_header, safe_layout_class,
	find_in_imports_on_demand, create_artificial_method,
	source_end_java_method, start_complete_expand_method,
	build_thisn_assign, java_complete_lhs,
	maybe_absorb_scoping_block): Likewise.

	objc
	* objc-act.c (objc_init): Rename lineno to input_line.
	(build_module_descriptor, build_selector_translation_table,
	build_protocol_template, build_method_prototype_list_template,
	build_category_template, build_selector_table,
	build_class_template, build_super_template, build_ivar_template,
	build_ivar_list_template, build_method_list_template,
	build_method_template, add_instance_variable): Likewise.

	treelang
	* tree1.c (treelang_init): Rename lineno to input_line.

From-SVN: r66333
2003-05-01 16:13:36 +00:00
Gabriel Dos Reis 0e42348d22 * diagnostic.c (output_pointer): Use HOST_PTR_PRINTF.
From-SVN: r66295
2003-04-30 16:12:58 +00:00
Gabriel Dos Reis 10256cf5f6 diagnostic.h (output_formatted_scalar): Tweak.
* diagnostic.h (output_formatted_scalar): Tweak.
        * diagnostic.c (output_long_decimal): Likewise.
        (output_unsigned_decimal): Likewise.
        (output_long_unsigned_decimal): Likewise.
        (output_octal): Likewise.
        (output_long_octal): Likewise.
        (output_hexadecimal): Likewise.
        (output_long_hexadecimal): Likewise.
        (output_pointer): New function.
        (output_format): Use it.  Recognize "%p" format specifier.

From-SVN: r66287
2003-04-30 12:54:29 +00:00
Geoffrey Keating 886e08657e diagnostic.c (real_abort): New.
* diagnostic.c (real_abort): New.
	(diagnostic_report_diagnostic): Call real_abort on error.
	* diagnostic.h (diagnostic_abort_on_error): New.
	(struct diagnostic_context): Add abort_on_error field.
	* toplev.c (setup_core_dumping): New.
	(decode_d_option): Handle 'H' case.
	* doc/invoke.texi (Debugging Options): Document -dH.

From-SVN: r62753
2003-02-12 01:05:47 +00:00
Kazu Hirata 95bd1dd72f alias.c: Fix comment typos.
* alias.c: Fix comment typos.
	* basic-block.h: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pretty-print.h: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgrtl.c: Likewise.
	* convert.c: Likewise.
	* cpphash.h: Likewise.
	* cpplex.c: Likewise.
	* cpplib.h: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarf2.h: Likewise.

From-SVN: r61462
2003-01-18 02:26:43 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Gabriel Dos Reis 9fc910d1ea * diagnostic.c (sorry): Don't repeat "sorry, unimplemented" text.
From-SVN: r59113
2002-11-14 21:34:19 +00:00
Zack Weinberg 36624850a4 system.h (GCCBUGURL): Delete.
* system.h (GCCBUGURL): Delete.
	* version.c (bug_report_url): New.  Add commentary about
	modifying both these strings in modified distributions.
	* version.h: Declare bug_report_url.

	* diagnostic.c, gcc.c, gcov.c, java/gjavah.c, java/jcf-dump.c,
	java/jv-scan.c: Globally replace GCCBUGURL with bug_report_url.

From-SVN: r57932
2002-10-08 17:27:39 +00:00
Jason Merrill 236a2ac8cc diagnostic.c (output_add_identifier): New fn.
* diagnostic.c (output_add_identifier): New fn.
        * diagnostic.h: Declare it.

From-SVN: r57066
2002-09-12 10:23:42 -04:00
Gabriel Dos Reis 9d533cb558 diagnostic.c (fancy_abort): Don't repeat "internal error".
* diagnostic.c (fancy_abort): Don't repeat "internal error".
	* toplev.c (crash_signal): Likewise.

From-SVN: r56669
2002-08-29 23:32:49 +00:00
Gabriel Dos Reis 9b32718c73 diagnostic.h (output_formatted_scalar): Rename from output_formatted_integer.
* diagnostic.h (output_formatted_scalar): Rename from
        output_formatted_integer.
        * diagnostic.def: Add DK_DEBUG.
        * diagnostic.c (output_decimal): Adjust.
        (output_long_decimal): Likewise.
        (output_unsigned_decimal): Likewise.
        (output_octal): Likewise.
        (output_long_octal): Likewise.
        (output_hexadecimal): Likewise.
        (output_long_hexadecimal): Likewise.
        * c-pretty-print.c (pp_c_type_specifier): New function.
        (pp_c_specifier_qualifier_list): Likewise.
        (pp_c_abstract_declarator): Likewise.
        (pp_c_char): Replace pp_format_integer with pp_format_scalar.

From-SVN: r56236
2002-08-12 18:34:51 +00:00
Gabriel Dos Reis 04c1334cba diagnostic.c (inform): New function.
* diagnostic.c (inform): New function.
	* diagnostic.h (inform): Declare.

From-SVN: r56022
2002-08-04 14:38:40 +00:00
Gabriel Dos Reis f63c45ec8e pretty-print.h: Define more macros.
* pretty-print.h: Define more macros.
	* diagnostic.h (output_formatted_integer): Moved from...
	* diagnostic.c: ... here.

From-SVN: r55833
2002-07-29 08:26:45 +00:00
Neil Booth 4fa31c2aae defaults.h (obstack_chunk_alloc, [...]): Default definition.
* defaults.h (obstack_chunk_alloc, obstack_chunk_free):
	Default definition.
	* gcse.c: Don't define obstack_chunk_free.
	* collect2.c, conflict.c, df.c, diagnostic.c, fix-header.c,
	flow.c, gcc.c, genattrtab.c, genautomata.c, genflags.c, gensupport.c,
	integrate.c, loop.c, ra.c, read-rtl.c, regrename.c, reload1.c,
	reorg.c, tlink.c, tree.c, config/arm/arm.c, objc/objc-act.c:
	Don't define obstack macros.
cp:
	* class.c, method.c, pt.c, search.c: Similarly.

From-SVN: r55665
2002-07-23 06:22:05 +00:00
Kaveh R. Ghazi ef9772c835 diagnostic.c (diagnostic_kind_text): Const-ify.
* diagnostic.c (diagnostic_kind_text): Const-ify.
	* gengtype.c (lang_names): Likewise.

From-SVN: r54840
2002-06-20 16:59:01 +00:00
Eric Christopher 3aafa0bbab diagnostic.c (output_format): Fix thinko.
2002-06-13  Eric Christopher  <echristo@redhat.com>

	* diagnostic.c (output_format): Fix thinko.

From-SVN: r54602
2002-06-13 23:31:56 +00:00
Gabriel Dos Reis c92bcccb95 diagnostic.c (output_format): Recognize "%H" as a format specifier for a location_t.
* diagnostic.c (output_format): Recognize "%H" as a format
	specifier for a location_t.
	(text_specifies_location): New function.
	(diagnostic_set_info): Use it.

From-SVN: r54584
2002-06-13 12:40:54 +00:00
Gabriel Dos Reis 13f0d49cdf objc-act.c (warn_with_ivar): Adjust calls to diagnostic_count_error.
* objc/objc-act.c (warn_with_ivar): Adjust calls to
	diagnostic_count_error.
	(warn_with_method): Likewise.

	* diagnostic.h (warnings_are_errors_message): New field of
	diagnostic_context.
	(diagnostic_count_error): Rename to
	diagnostic_count_diagnostic to
	match semantics.
	* diagnostic.c: Adjust calls to diagnostic_count_error through
	out.
	(diagnostic_count_diagnostic): Make aware of other kinds of
	diagnostics.
	(diagnostic_initialize): Initialize
	warnings_are_errors_message field.

f/
2002-06-12  Gabriel Dos Reis  <gdr@codesourcery.com>

	    * bad.c (ffebad_start_): Adjust calls to
              diagnostic_count_error.

From-SVN: r54532
2002-06-11 23:11:34 +00:00
Gabriel Dos Reis caef5b46fb * diagnostic.c (diagnostic_build_prefix): Fix initialization.
From-SVN: r54343
2002-06-07 16:35:52 +00:00
Gabriel Dos Reis 4b1d52c7ae * diagnostic.c (diagnostic_build_prefix): Tidy.
From-SVN: r54337
2002-06-07 13:00:43 +00:00
Gabriel Dos Reis 47b69537e4 toplev.h (report_error_function): Remove.
* toplev.h (report_error_function): Remove.

	* diagnostic.h (location_t): New datatype.
	(text_info): Likewise.
	(diagnostic_info): Likewise.
	(output_prefix): New macro.
	(diagnostic_last_function_changed): Likewise.
	(diagnostic_set_last_function): Likewise.
	(diagnostic_last_module_changed): Likewise.
	(diagnostic_set_last_module): Likewise.
	(report_diagnostic): Now macro.
	(diagnostic_set_info): Declare.

	* diagnostic.c (report_problematic_module): Rename to
	diagnostic_repor_current_module.
	(set_diagnostic_context): Remove.
	(count_error): Rename to diagnostic_error_count.
	(error_function_changed): Remove.
	(record_last_error_function): Likewise.
	(error_module_changed): Likewise.
	(record_last_error_module): Likewise.
	(context_as_prefix): Rename to diagnostic_build_prefix.
	(flush_diagnostic_buffer): Rename to diagnostic_flush_buffer.
	(diagnostic_set_info): New function.

	* objc/objc-act.c: #include diagnostic.h
	(error_with_ivar): Adjust call to count_error.
	(warn_with_method): Likewise.
	* objc/Make-lang.in (objc-act.o): Depend on diagnostic.h

cp/
2002-06-04  Gabriel Dos Reis  <gdr@codesourcery.com>

	* error.c (cp_diagnostic_starter): Adjust call.
	(maybe_print_instantiation_context): Change prototype to take a
	'diagnostic_info *'.
	(print_instantiation_full_context): Likewise.
	(print_instantiation_partial_context): Likewise.
	(cp_diagnostic_starter): Likewise.
	(cp_diagnostic_finalizer): Likewise.
	(cp_print_error_function): Likewise.
	(cp_printer): Take a secondary parameter as a 'text_info *'.
	Remove output_state savings.  Adjust calls.

f/
2002-06-04  Gabriel Dos Reis  <gdr@codesourcery.com>

	* bad.c (ffebad_start_): Adjust call to count_error.
	* Make-lang.in (f/bad.o): Depend on diagnostic.h
	* bad.c: #include diagnostic.h

From-SVN: r54291
2002-06-05 19:35:45 +00:00
Gabriel Dos Reis 27e511e0d5 diagnostic.h (struct diagnostic_context): Add new member internal_error.
* diagnostic.h (struct diagnostic_context):  Add new member
	internal_error.
	(internal_error_function): Remove declaration.
	* diagnostic.c (internal_error_function): Remove definition..
	(internal_error): Adjust use.
ada/
	* misc.c (gnat_init): Adjust setting of internal_error_function.

From-SVN: r54179
2002-06-02 19:06:30 +00:00
Gabriel Dos Reis 167143a01e diagnostic.c (diagnostic_finish): Rename to output_flush.
* diagnostic.c (diagnostic_finish): Rename to output_flush.
	(clear_disgnostic_info): Rename to output_clear_data.  Use
	false
	instead of 0 for boolean value.
	Adjust function call throughout.

From-SVN: r54176
2002-06-02 17:36:29 +00:00
Kazu Hirata 3a538a6668 dbxout.c: Fix formatting.
* dbxout.c: Fix formatting.
	* dependence.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* doloop.c: Likewise.
	* dominance.c: Likewise.
	* doschk.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.

From-SVN: r53380
2002-05-11 10:47:05 +00:00
Gabriel Dos Reis bd6bec6be2 diagnostic.h (output_buffer_state): Redefine.
* diagnostic.h (output_buffer_state): Redefine.
	(output_format_decoder): New macro.
	(output_prefixing_rule): Likewise.
	(output_line_cutoff): Likewise.
	(diagnostic_format_decoder): Adjust.
	(diagnostic_prefixing_rule): Likewise.
	(diagnostic_line_cutoff): Likewise.
	(diagnostic_state): Likewise.
	(diagnostic_kind_count): Likewise.
	(diagnostic_buffer): Now a macro.

	* diagnostic.c (diagnostic_buffer): Remove definition.
	(output_is_line_wrapping): Adjust.
	(set_real_maximum_length): Likewise.
	(output_set_maximum_length): Likewise.
	(init_output_buffer): Likewise.
	(lhd_print_error_function): Likewise.
	(output_do_verbatim): Likewise.

cp/
	* error.c (cxx_print_error_function): Adjust call to macros.

From-SVN: r52307
2002-04-14 23:35:36 +00:00
Neil Booth b18101c75f diagnostic.c: Include langhooks-def.h.
* diagnostic.c: Include langhooks-def.h.
	* Makefile.in (diagnostic.o): Update.

From-SVN: r51674
2002-03-31 22:59:14 +00:00
Neil Booth 7cb3282270 diagnostic.c (print_error_function): Remove.
* diagnostic.c (print_error_function): Remove.
	(default_print_error_function): Rename.
	(report_error_function): Update.
	* diagnostic.h (print_error_function): Remove.
	(default_print_error_function): Remove.
	* langhooks-def.h (struct diagnostic_context): Predeclare.
	(lhd_print_error_function, LANG_HOOKS_PRINT_ERROR_FUNCTION): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (struct diagnostic context): Predeclare.
	(struct lang_hooks): New hook.
cp:
	* Make-lang.in (error.o): Update.
	* cp-lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
	* cp-tree.h (struct diagnostic_context): Predeclare.
	(cxx_print_error_function): New.
	* error.c: Include langhooks-def.h.
	(lang_print_error_function): Rename.  Update.
	(init_error): Don't set hook.
f:
	* com.c (lang_print_error_function): Rename.
	(LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
	(ffe_init): Don't set hook.
java:
	* lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
	(java_dummy_print): Remove.
	(lang_print_error): Rename.  Exit early if inhibiting output.
	(inhibit_error_printing_function): New.
	(java_init): Don't set hook.
	(lang_init_source): Use new boolean.

From-SVN: r51672
2002-03-31 22:32:05 +00:00
Neil Booth 7afff7cfb0 Makefile.in: Update.
* Makefile.in: Update.
	* c-common.c: Include langhooks.h.
	(inline_forbidden_p): Use new hook.
	* diagnostic.c: Include langhooks.h.
	(format_with_decl, announce_function,
	default_print_error_function): Use new hook.
	* dwarf2out.c (dwarf2_name): Use new hook.
	* function.c: Include langhooks.h.
	(init_function_start): Use new hook.
	* langhooks-def.h (lhd_decl_printable_name): New.
	(LANGHOOKS_DECL_PRINTABLE_NAME): New.
	(LANGHOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_decl_printable_name): New.
	* langhooks.h (struct lang_hooks): New hook.
	* toplev.c (decl_name, decl_printable_name): Remove.
	(open_dump_file): Use new hook.
	(process_options): Remove old hook.
	* tree.h (decl_printable_name): Remove.
ada:
	* misc.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(gnat_init): Remove old hook.
cp:
	* cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	* cp-tree.h (lang_printable_name): Rename.
	* error.c (lang_decl_name): Use new hook.
	* lex.c (cxx_init): Remove old hook.
	* pt.c (tsubst_expr): Use new hook.
	* tree.c (lang_printable_name): Rename.
f:
	* com.c (lang_printable_name): Rename.
	(LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(ffe_init): Don't use old hook.
java:
	* decl.c (start_java_method): Use new hook.
	* lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(java_init): Remove old hook.
objc:
	* objc-act.c (objc_init): Remove old hook.
	(objc_printable_name): Export.
	* objc-act.h (objc_printable_name): New.
	* objc-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.

From-SVN: r51066
2002-03-20 07:58:41 +00:00
Zack Weinberg a63bea75b1 diagnostic.c (internal_error): Do ICE suppression only when ENABLE_CHECKING is not defined.
* diagnostic.c (internal_error): Do ICE suppression only
	when ENABLE_CHECKING is not defined.

From-SVN: r49151
2002-01-23 19:34:08 +00:00
Richard Kenner 93efb9de8c Properly indent two lines.
From-SVN: r49043
2002-01-21 07:35:58 -05:00
Richard Kenner bb93b973c9 diagnostic.c (warn_deprecated_use): Rework to lower indentation.
* diagnostic.c (warn_deprecated_use): Rework to lower indentation.
	* expr.c (emit_move_insn_1): Remove warning, use HOST_WIDE_INT for
	offsets, and change line folding.
	* optabs.c (expand_binop): Remove warnings.
	* sdbout.c (sdbout_record_type_name): Constify NAME to avoid warning.

From-SVN: r48801
2002-01-12 09:05:32 -05:00
Graham Stott f9f6b7df9d attribs.c (handle_deprecated_attribute): constify WHAT.
* attribs.c (handle_deprecated_attribute): constify WHAT.
        * diagnostic.c (warn_deprecated_use): Add braces, fixes
        dangling else warning and constify WHAT.
        * except.h (struct function, struct inline_remap): Move
        struct tag forward defs before all prototypes.
        (duplicate_eh_regions): Whitespace.

From-SVN: r48799
2002-01-12 13:45:39 +00:00
Ira Ruben e23bd2185f Added __attribute__((deprecated)) patches.
From-SVN: r48743
2002-01-10 18:51:24 +00:00
Kazu Hirata 173bf5be74 c-common.c: Fix formatting.
* c-common.c: Fix formatting.
	* diagnostic.c: Likewise.
	* doloop.c: Likewise.
	* dwarf2out.c: Likewise.

From-SVN: r48526
2002-01-04 02:00:26 +00:00
Jason Merrill 4ff8507ec5 diagnostic.c (sorry): Increment sorrycount before saving the buffer state.
* diagnostic.c (sorry): Increment sorrycount before saving the
        buffer state.

From-SVN: r48005
2001-12-14 15:13:55 -05:00
Joseph Myers a1f300c0f1 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog,
	FSFChangeLog.10, c-decl.c, cppfiles.c, cppinit.c, cpplex.c,
	cpplib.c, cppmain.c, cse.c, df.c, diagnostic.c, dominance.c,
	dwarf2out.c, dwarfout.c, emit-rtl.c, errors.c, except.c, except.h,
	explow.c, function.c, gcse.c, genrecog.c, predict.c, regmove.c,
	sched-rgn.c, ssa-ccp.c, stmt.c, toplev.c: Fix spelling errors.

From-SVN: r47279
2001-11-23 02:05:19 +00:00
Kaveh R. Ghazi 83182544db c-parse.in (yyerror): Const-ification and/or static-ization.
* c-parse.in (yyerror): Const-ification and/or static-ization.
	* c-typeck.c (push_member_name): Likewise.
	* collect2.c (main): Likewise.
	* dbxout.c (dbxout_parms): Likewise.
	* diagnostic.c (format_with_decl): Likewise.
	* dwarf2out.c (output_ranges): Likewise.
	* dwarfout.c (fundamental_type_code): Likewise.
	* except.c (dw2_output_call_site_table): Likewise.
	* gcc.c (do_spec_1): Likewise.
	* genopinit.c (optabs): Likewise.
	* objc/objc-act.c (synth_id_with_class_suffix, start_class,
	gen_declaration_1, handle_impent): Likewise.
	* protoize.c (default_include, in_system_include_dir, abspath):
	Likewise.
	* sched-vis.c (visualize_stall_cycles): Likewise.
	* sdbout.c (plain_type_1, sdbout_end_function,
	sdbout_end_epilogue): Likewise.
	* varasm.c (decode_reg_name): Likewise.

	* 1750a.c (mod_regno_adjust): Likewise.
	* alpha.c (alpha_write_one_linkage,
	unicosmk_output_default_externs): Likewise.
	* arm.c (arm_condition_codes): Likewise.
	* arm.h (arm_condition_codes): Likewise.
	* avr.c (output_movsisf, encode_section_info): Likewise.
	* darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL):
	Likewise.
	* i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* m88k.c (output_function_profiler): Likewise.
	* mips.c (mips_output_conditional_branch): Likewise.
	* ns32k.c (ns32k_out_reg_names): Likewise.
	* ns32k.h (ns32k_out_reg_names): Likewise.
	* pj.c (pj_output_rval): Likewise.
	* rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise.
	* sparc.c (sparc_flat_function_prologue,
	sparc_flat_function_epilogue): Likewise.

cp:
	* decl.c (warn_extern_redeclared_static, cp_make_fname_decl):
	Const-ification.
	* pt.c (tsubst_decl): Likewise.

f:
	* bad.c (ffebad_finish): Const-ification and/or static-ization.
	* intrin.c (ffeintrin_cmp_name_): Likewise.
	* stc.c (ffestc_R904): Likewise.

java:
	* expr.c (expand_invoke): Const-ification.
	* parse.y (patch_method_invocation): Likewise.

From-SVN: r45581
2001-09-13 14:37:29 +00:00
Andreas Jaeger 79e8ec0eb2 (forgot in last checkin)
Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.

From-SVN: r45223
2001-08-28 06:55:48 +02:00
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00
Zack Weinberg d9b6874b0c final.c (shorten_branches): Clear the end of the label_align array only if we made it larger.
* final.c (shorten_branches): Clear the end of the label_align
	array only if we made it larger.  Break up messy expressions
	for clarity.

	* diagnostic.c (internal_error): Check for error recursion
	before doing ICE suppression.

	* timevar.c: Timing variables now count in milliseconds.
	(init_timevar): Set up ticks_to_msec and clocks_to_msec here.
	(get_time): Not here.
	(timevar_print): Don't print any timer whose user, cpu, and
	wall times are all zero as displayed.
	* timevar.h: Update comment aboout units.  Make timevar
	counters unsigned.

From-SVN: r44948
2001-08-17 01:27:49 +00:00
Gabriel Dos Reis c895acf211 Makefile.in (OBJS): Add rtl-error.o
* Makefile.in (OBJS): Add rtl-error.o
	(rtl-error.o): New rule.
	(diagnostic.o): Adjust dependency.
	diagnostic.c (file_and_line_for_asm, diagnostic_for_asm,
	error_for_asm, _fatal_insn, _fatal_insn_not_found,
	warning_for_asm): Move to...
	rtl-error.c: ...here.  New file.

From-SVN: r44894
2001-08-14 19:22:48 +00:00
Kazu Hirata 30f7a3786c dbxout.c: Fix comment formatting.
* dbxout.c: Fix comment formatting.
	* dependence.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* dominance.c: Likewise.
	* doprint.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.

From-SVN: r44729
2001-08-08 22:06:48 +00:00
Gabriel Dos Reis 64dfaa76b3 diagnostic.c (finish_diagnostic): Rename to diagnostic_finish.
* diagnostic.c (finish_diagnostic): Rename to
        diagnostic_finish. Make it take an 'output_buffer *'.  Adjust
        calls thourghout.

From-SVN: r43905
2001-07-10 16:04:55 +00:00
Gabriel Dos Reis 46f018e138 diagnostic.c (default_print_error_function): Tweak.
* diagnostic.c (default_print_error_function): Tweak.
	(report_error_function): Likewise.
	* toplev.h (default_print_error_function): Move to...
	* diagnostic.h: ...here. Add a `diagnostic_context *' parameter.
	* tree.h (print_error_function): Move to...
	* diagnostic.h: ...here. Add a `diagnostic_context *' parameter.

ch/

	* lang.c: #include diagnostic.h
	(chill_print_error_function): Add a dummy `diagnostic_context *'.
	* Makefile.in (lang.o): Depend on diagnostic.h

cp/

	* error.c (lang_print_error_function): Add a `diagnostic_context *'
	parameter. Tweak.

f/

	* Make-lang.in (f/com.o): Depend on diagnostic.h
	* com.c: #include diagnostic.h
	(lang_print_error_function): Take a 'diagnostic_context *'.

java/

	* lang.c: #include diagnostic.h
	(lang_print_error): Add a `diagnostic_context *' parameter.
	(java_dummy_print): Likewise.
	* Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h

From-SVN: r43638
2001-06-28 12:26:38 +00:00
Gabriel Dos Reis 6b67c26e61 diagnostic.h: Add documentation.
2001-06-27  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.h: Add documentation. Make macros polymorphic.
	* diagnostic.c (ideal_line_wrap_cutoff): Remove
	definition. Replace with diagnostic_line_cutoff.
	(prefixing_policy): Remove. Replace with diagnostic_prefixing_rule.

From-SVN: r43616
2001-06-27 18:03:03 +00:00
Gabriel Dos Reis 9596ddd67e toplev.c (decode_f_option): Adjust setting.
* toplev.c (decode_f_option): Adjust setting.
	(toplev_main): Call diagnostic_initialize.  Remove call to
	reshape_diagnostic_buffer._

	* diagnostic.h (struct output_buffer): Add new field format_decoder.
	(diagnostic_format_decoder): New macro.
	(diagnostic_prefixing_rule): Likewise.
	(diagnostic_line_cutoff): Likewise.
	(set_message_prefixing_rule): Remove.

	* diagnostic.c (lang_printer): Remove.
	(diagnostic_message_length_per_line): Likewise.
	(current_prefixing_rule): Likewise.
	(initialize_diagnostics): Rename to...
	(diagnostic_initialize): ...this. Tweak.
	(default_initialize_buffer): Remove.
	(reshape_diagnostic_buffer): Likewise.
	(init_output_buffer): Adjust prefixing rule setting.
	(output_format): Use format_decoder from the output_buffer.

	* c-lang.c (c_init): Adjust tree formatter setting.

cp/
  	* error.c (init_error): Adjust settings.

From-SVN: r43588
2001-06-26 19:18:37 +00:00
Gabriel Dos Reis f68fc4db62 diagnostic.h (struct diagnostic_context): Add new field.
* diagnostic.h (struct diagnostic_context): Add new field.
	(lang_diagnostic_starter, lang_diagnostic_finalizer): Remove
	declaratons.
	(global_dc): Declare.
	* diagnostic.c (global_diagnostic_context): New variable.
	(global_output_buffer): Remove.
	(global_dc): Define.
	(lang_diagnostic_starter, lang_diagnostic_finalizer): Remove
 	definitions.
	(initialize_diagnostics): Adjust initialization.
	(set_diagnostic_context): Adjust setting.

cp/

	* error.c (init_error): Adjust settings.

From-SVN: r43581
2001-06-26 14:06:07 +00:00
Gabriel Dos Reis 0deaa8136a diagnostic.h (diagnostic_prefixing_rule_t): New enum type.
* diagnostic.h (diagnostic_prefixing_rule_t): New enum type.
	(set_message_prefixing_rule): Adjust prototype.
	* diagnostic.c (current_prefixing_rule): Adjust type.

From-SVN: r43573
2001-06-26 07:53:50 +00:00
Gabriel Dos Reis 255fcfbb81 diagnostic.c (digit_buffer): Remove as global.
* diagnostic.c (digit_buffer): Remove as global.  Move to...
	* diagnostic.h (struct output_buffer): ... here.
	* diagnostic.c (output_formatted_integer): Adjust use of digit_buffer.

From-SVN: r43567
2001-06-26 05:42:06 +00:00
Gabriel Dos Reis 2a2b2d432e Makefile.in (c-parse.o): Depend on diagnostic.h
gcc/

2001-06-10  Mark Mitchell <mark@codesourcery.com>
	    Gabriel Dos Reis  <gdr@codesourcery.com>

	* Makefile.in (c-parse.o): Depend on diagnostic.h
	(dwarf2out.o): Likewise.

	* dwarf2out.c: #include diagnostic.h

	* toplev.h (warningcount, errorcount, sorrycount): Remove
	declarations.

	* toplev.c (warningcount, errorcount, sorrycount): Remove
	definitions.

	* diagnostic.h (struct output_buffer): Reorder fields.
	(diagnostic_kind_count): New macro.
	(errorcount, warningcount, sorrycount): Define as macros.
	(diagnostic_report_warnings_p): New macro.
	(output_state): Add diagnostic_count field.

	* diagnostic.c (warningcount, errorcount, inhibit_warnings):
	Remove tentative declaration.
	(count_error): Use diagnostic_report_warnings_p.

	* c-parse.in: #include diagnostic.h

ch/

2001-06-10  Gabriel Dos Reis  <gdr@codesourcery.com>

	* decl.c: #include diagnostic.h
	* actions.c: #include diagnostic.h
	* Makefile.in (actions.o): Depend on diagnostic.h
	(decl.o): Depend on diagnostic.h

cp/

2001-06-10  Mark Mitchell <mark@codesourcery.com>
	    Gabriel Dos Reis  <gdr@codesourcery.com>

	* Make-lang.in (cp/call.o): Depend on diagnostic.h
	(cp/typeck.o): Depend on diagnostic.h
	(cp/typeck2.o): Depend on diagnostic.h
	(cp/repo.o): Depend on dignostic.h
	* typeck.c: #include diagnostic.h
	(convert_for_initialization): Remove extern declaration for
	warningcount and errorcount.

	* call.c: #include diagnostic.h
	(convert_like_real): Remove extern declaration for warnincount and
	errorcount.

	* repo.c: #include diagnostic.h
	* typeck2.c: #include diagnostic.h

From-SVN: r43140
2001-06-10 13:48:04 +00:00
Zack Weinberg 1f8875f91d diagnostic.c (vnotice): Kill.
2001-05-23  Zack Weinberg  <zackw@stanford.edu>

	* diagnostic.c (vnotice): Kill.
	(fnotice): Call vfprintf directly.
	(diagnostic_for_decl, output_do_verbatim, output_verbatim,
	verbatim, set_diagnostic_context): Rename string argument to
	indicate that it is run through gettext.
	(vbuild_message_string, build_message_string, output_do_printf):
	Rename string argument to indicate that it is NOT run through
	gettext.
	(output_printf, diagnostic_for_decl, fatal_io_error, sorry,
	output_do_verbatim, set_diagnostic_context, fnotice, _fatal_insn):
	Run msgid argument through gettext.
	(default_print_error_function): Run constant strings through
	gettext when nothing else will.
	(fatal_error, internal_error, error_recursion): Use fnotice.
	Present complete sentences to gettext.

From-SVN: r42498
2001-05-23 17:15:07 +00:00
Richard Henderson 5e7f4a4ab9 mkconfig.sh: Include insn-flags.h.
* mkconfig.sh: Include insn-flags.h.
	* Makefile.in (CONFIG_H): Include insn-flags.h.
	(lots of objects): Remove insn-codes.h and insn-flags.h.

	* alias.c, bb-reorder.c, calls.c, do-loop.c, flow.c, haifa-sched.c,
	integrate.c, jump.c, loop.c, predict.c, profile.c, reg-stack.c,
	regmove.c, reorg.c, a29k/a29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c,
	avr/avr.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c,
	dsp16xx/dsp16xx.c, fr30/fr30.c, h8300/h8300.c, i370/i370.c,
	i386/i386.c, i860/i860.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c,
	m68k/m68k.c, m88k/m88k.c, mcore/mcore.c, mn10200/mn10200.c,
	mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c,
	pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c,
	v850/v850.c, vax/vax.c:
	Don't include insn-flags.h.

	* diagnostic.c, expr.h, reload.c, toplev.c:
	Don't include insn-codes.h.

	* builtins.c, combine.c, except.c, explow.c, expmed.c, expr.c,
	final.c, function.c, optabs.c, recog.c, reload1.c, stmt.c,
	c4x/c4x.c, i960/i960.c, mips/mips.c:
	Don't include insn-codes.h or insn-flags.h.

	* genemit.c, genopinit.c, genoutput.c: Don't include insn-codes.h
	or insn-flags.h in the generated code.
	* genflags.c (gen_proto): Use "struct rtx_def *" instead of "rtx".
	(main): Forward declare struct rtx_def.

From-SVN: r40754
2001-03-22 10:48:52 -08:00
Richard Kenner fce687f876 diagnostic.c (trim_filename): No longer static.
* diagnostic.c (trim_filename): No longer static.
	* toplev.h (trim_filename): Declare.
	* rtl.c (rtl_check_failed_bounds): Call internal_error.
	(rtl_check_failed_type1, rtl_check_failed_type2): Likewise.
	(rtl_check_failed_code1, rtl_check_failed_code2): Likewise.
	(rtvec_check_failed_bounds): Likewise.
	* tree.c (tree_check_failed, tree_class_check_failed): Likewise.

From-SVN: r40016
2001-02-23 16:17:06 -05:00
Gabriel Dos Reis 3d7c9b7e5b diagnostic.c (output_to_stream): Rename to output_buffer_to_stream.
* diagnostic.c (output_to_stream): Rename to
	output_buffer_to_stream. Loses the stream parameter.
	(init_output_buffer): Set diagnosic_buffer's stream.
	(flush_diagnostic_buffer): Adjust.
	(default_print_error_function): Likewise.
	(finish_diagnostic): Likewise.
	(verbatim): Likewise.

	* diagnostic.h (struct output_buffer): Add `stream' field.
	(output_buffer_attached_stream): New macro.

From-SVN: r39999
2001-02-23 17:28:25 +00:00
Richard Kenner e28a09a451 * diagnostic.c (_fatal_insn): Decrement errorcount.
From-SVN: r39834
2001-02-18 10:17:36 -05:00
Jason Merrill 33c4f1746c diagnostic.c (internal_error): Say "confused" after 1 error, not two.
* diagnostic.c (internal_error): Say "confused" after 1 error, not
        two.  Print file and line with "confused" message.

From-SVN: r39543
2001-02-08 12:18:47 -05:00
Richard Kenner 400500c4a5 diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
	* toplev.h (internal_error): Renamed from fatal.
	(pfatal_with_name): Deleted.
	(fatal_io_error): Now has printf-style arguments.
	* diagnostic.c (pfatal_with_name): Deleted.
	(fatal_io_error): Rework to have args in printf-style.
	(set_internal_error_function): Renamed from set_fatal_function.
	(internal_error): Renamed from fatal.
	(error_recursion, fancy_abort): Call internal_error instead of fatal.
	* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
	* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
	* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
	* flow.c (verify_flow_info): Likewise.
	* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
	* config/mips/mips.c (save_restore_insns): Likewise.
	* cp/init.c (build_java_class_ref): Likewise.
	(dsp16xx_reg_class_from_letter): Likewise.
	(limit_reload_class, double_reg_to_memory): Likewise.
	(print_operand_address, emit_1600_code_shift): Likewise.
	(gen_tst_reg, gen_compare_reg): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
	* cp/decl.c (pushdecl): Likewise.
	* java/check-init.c (check_init): Likewise.
	* java/expr.c (java_lang_expand_expr): Likewise.
	* java/jcf-parse.c (get_constant): Likewise.
	* java/mangle.c (java_mangle_decl): Likewise.
	* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
	(operator_string): Likewise.

	* except.c (duplicate_eh_handlers): Call abort instead of fatal.
	* flow.c (verify_flow_info): Likewise.
	* ch/convert.c (convert): Likewise.
	* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
	* ch/expr.c (chill_expand_expr): Likewise.
	* ch/parse.c (peek_token_, pushback_token, require): Likewise.
	* config/arm/arm.c (thumb_load_double_from_address): Likewise.
	* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
	(avr_normalize_condition): Likewise.
	* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
	* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
	(limit_reload_class, double_reg_to_memory): Likewise.
	(print_operand_address, emit_1600_code_shift): Likewise.
	(gen_tst_reg, gen_compare_reg): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
	* cp/decl.c (pushdecl): Likewise.
	* java/check-init.c (check_init): Likewise.
	* java/class.c (build_class_ref): Likewise.
	* java/constants.c (write_constant_pool): Likewise.
	* java/decl.c (start_java_method): Likewise.
	* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
	(java_stack_dup, encode_newarray_type): Likewise.
	(build_java_array_length_access): Likewise.
	(build_java_check_indexed_type, expand_java_pushc): Likewise.
	(build_java_soft_divmod, build_invokeinterface): Likewise.
	* java/java-tree.h (INNER_CLASS_P): Likewise.
	* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
	(give_name_to_class, get_class_constant): Likewise.
	* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
	(find_constant_index, generate_bytecode_conditional): Likewise.
	(generate_bytecode_insns, perform_relocations): Likewise.
	* java/lex.c (java_unget_unicode, java_lex): Likewise.
	* java/mangle.c (mangle_type, mangle_record_type): Likewise.
	(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
	(finish_mangling): Likewise.
	* java/parse.h (MARK_FINAL_PARMS): Likewise.
	* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
	(obtain_incomplete_type, java_complete_class): Likewise.
	(java_check_regular_methods, java_complete_expand_method): Likewise.
	(cut_identifier_in_qualified, check_deprecation): Likewise.
	(patch_invoke, find_applicable_accessible_methods_list): Likewise.
	(java_complete_lhs, lookup_name_in_blocks): Likewise.
	(check_final_variable_indirect_assignment, build_unaryop): Likewise.
	* java/typeck.c (set_local_type, parse_signature_type): Likewise.
	(parse_signature_string, build_java_signature): Likewise;
	(set_java_signature): Likewise.
	* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.

	* c-parse.in (methoddef): Call fatal_error instead of fatal.
	* objc/objc-act.c (build_ivar_chain): Likewise.
	* cp/except.c (decl_is_java_type): Likewise.
	* cp/init.c (build_java_class_ref): Likewise.
	* cp/init.c (build_new_1): Likewise.
	* f/com.c (ffecom_init_0): Likewise.
	* java/class.c (add_method, build_static_field_ref): Likewise.
	* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
	* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
	* java/lex.c (java_new_new_lexer): Likewise.
	* java/jv-scan.c (main): Likewise.
	(fatal_error): Renamed from fatal.

	* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
	pfatal_with_name.
	* graph.c (clean_graph_dump_file): Likewise.
	* profile.c (init_branch_prob): Likewise.
	* ch/grant.c (write_grant_file): Likewise.
	* ch/lex.c (init_parse, same_file, yywrap): Likewise.
	* f/com.c (init_parse): Likewise.
	* java/jcf-parse.c (yyparse): Likewise.
	* objc/objc-act.c (objc_init): Likewise.

	* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
	(yyparse): Likewise.
	* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
	* java/lex.c (java_get_line_col): Likewise.

	* hash.c (hash_allocate): Don't check for failure returns from
	obstack functions that can't fail.
	(hash_table_init_n, hash_table_init): Likewise; also now return void.
	* hash.h (hash_table_init_n, hash_table_init): Now return void.
	* cp/decl.c (build_typename_type): hash_table_init now returns void.

	* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
	* ch/lex.c (convert_bitstring): Delete check for alloca failure.
	* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
	Deleted.
	* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.

	* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
	* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
	(ffelex_hash_): Likewise.
	* config/arm/arm.c (arm_override_options): Likewise.
	* config/avr/avr.c (avr_override_options): Likewise.
	* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
	* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
	* config/h8300/h8300.c (h8300_init_once): Likewise.
	* config/mips/mips.c (override_options): Likewise.
	* config/i386/i386.c (override_options): Likewise, rework.
	* config/m68k/m68k.c (override_options): Likewise.
	* cp/decl.c (init_decl_processing): Likewise.
	* java/jcf-parse.c (load_class): Likewise.

	* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
	instead of fatal.
	* config/mips/mips.c (print_operand): Likewise.

	* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
	* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
	(get_object_reference): Likewise.

From-SVN: r39443
2001-02-04 17:44:12 -05:00
Neil Booth bdda33259f * diagnostic.c (fatal): Fix word wrap.
From-SVN: r39356
2001-01-30 23:47:33 +00:00
Neil Booth 7fa531a6eb * diagnostic.c (fatal): Request preprocessed source.
From-SVN: r39258
2001-01-25 07:39:50 +00:00
Richard Kenner 43db5b3c2c diagnostic.c (finish_abort): Deleted.
Sat Dec 16 10:41:11 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* diagnostic.c (finish_abort): Deleted.
	(fatal): Add code from fninish_abort.
	(error_recursion, fancy_abort): Call fatal, not finish_abort.
	(trim_filename): Remove leading "../".
	* diagnostic.h (finish_abort): Deleted.
	* toplev.c (crash_signal): Call fatal, not finish_abort.

	* stor-layout.c (place_field): Treat overflowing DECL_SIZE_UNIT
	as if size were variable.

	* expmed.c (expand_mult): Write REG_EQUAL note with proper mode.

From-SVN: r38309
2000-12-16 11:23:46 -05:00
Jason Merrill 62c0790555 stor-layout.c (int_mode_for_mode): Handle MODE_VECTOR_INT, MODE_VECTOR_FLOAT.
* stor-layout.c (int_mode_for_mode): Handle MODE_VECTOR_INT,
        MODE_VECTOR_FLOAT.

        * diagnostic.c (report_problematic_module): s/function/module/.

        * c-lex.h: Remove decl for check_newline.

From-SVN: r38003
2000-12-04 12:14:16 -05:00
Phil Edwards c4765d18f2 diagnostic.c: Fix typos in comments.
2000-12-01  Phil Edwards  <pme@sources.redhat.com>

	* diagnostic.c:  Fix typos in comments.
	* diagnostic.h:  Likewise.

From-SVN: r37923
2000-12-01 19:31:01 +00:00
Zack Weinberg 520a57c81c stringpool.c: New file.
* stringpool.c: New file.
	* ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete.
	(ggc_alloc_string): Now in stringpool.o.
	* ggc-page.c, ggc-simple.c: Do not define or allocate empty_string.
	* ggc.h: Delete prototype of ggc_add_string_root.  #define
	ggc_add_string_root and ggc_mark_string to nothing.  Prototype
	init_stringpool and stringpool_statistics.
	(ggc_alloc_string): Returns a const char *.
	* tree.c (hash_table, do_identifier_warnings): Delete.
	(init_obstacks): Don't initialize the identifier hash table.
	(get_identifier, maybe_get_identifier, start_identifier_warnings,
	set_identifier_size): Now in stringpool.c.
	* tree.h (struct tree_string): Constify pointer field.
	(approx_sqrt): Prototype.

	* Makefile.in (stringpool.o): Add rule, mention in OBJS.

	* toplev.c (approx_sqrt): New function.
	(compile_file): Call stringpool_statistics if mem_report is on.
	(main): Call init_stringpool.

	* builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c
	(process_directive), c-typeck.c (constructor_asmspec, struct
	initializer_stack, start_init), except.c (create_rethrow_ref),
	stmt.c (digit_strings), toplev.c (decode_f_option), tree.c
	(built_in_filename), varasm,c (in_named_name,
	assemble_static_space, struct constant_descriptor, struct
	deferred_string, struct pool_constant, force_const_mem),
	i386.c (pic_label_name, global_offset_table_name), rs6000.c
	(rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *.

	* c-common.c (combine_strings): Combine strings in scratch
	buffer, then pass to build_string.
	* optabs.c (init_libfuncs), profile.c (init_edge_profiler,
	output_func_start_profiler), stmt.c (init_stmt), alpha.c
	(alpha_need_linkage), arm.c (arm_encode_call_attribute),
	i386.c (load_pic_register), ia64.c (ia64_encode_section_info),
	rs6000.c (rs6000_encode_section_info): Create string in
	scratch buffer, then pass to ggc_alloc_string.

	* stmt.c (expand_asm_operands): If we must adjust the
	constraint strings, do so by creating a new one, not by
	modifying the old one in place.  Constify some char *s.
	* config/pa/pa.c (hppa_encode_label): Drop unnecessary second
	argument.  Create string in scratch buffer, then pass to
	ggc_alloc_string.
	* config/pa/pa-protos.h: Update prototype.
	* config/pa/elf.h, config/pa/pa.h, config/pa/som.h:
	hppa_encode_label takes only one argument.

	* c-parse.in (if_prefix): Find the filename and line number at
	$-2 and $-1 respectively.
	* diagnostic.c (error_recursion): Add missing newline, use
	fputs, translate string.

cp:
	* lex.c (struct impl_files, internal_filename): Constify a char *.
java:
	* jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
	Create string in scratch buffer, then pass to build_string.

From-SVN: r37514
2000-11-17 06:05:31 +00:00
Jason Merrill ee3400e881 diagnostic.c (finish_abort): New fn.
* diagnostic.c (finish_abort): New fn.
        (fancy_abort, error_recursion): Use it.
        * toplev.c (crash_signal): Likewise.
        * diagnostic.h: Declare it.

        * typeck2.c (friendly_abort): Uncount the error before handing
        off to fancy_abort.

From-SVN: r37480
2000-11-15 10:50:51 -05:00
Joseph Myers 88f3c47786 diagnostic.c (vbuild_message_string, [...]): Add ATTRIBUTE_PRINTF.
* diagnostic.c (vbuild_message_string, output_do_printf, vnotice):
	Add ATTRIBUTE_PRINTF.
	* tradcpp.c (v_message, warning, error, fatal, error_with_line):
	Add ATTRIBUTE_PRINTF*.

java:
	* parse.y (issue_warning_error_from_context): Add
	ATTRIBUTE_PRINTF.

From-SVN: r37419
2000-11-13 13:23:37 +00:00
Joseph Myers 961192e1dd alias.c [...] (init_alias_analysis, [...]): Use memset () instead of bzero ().
* alias.c (init_alias_analysis), calls.c (expand_call,
	emit_library_call_value_1), combine.c (init_reg_last_arrays),
	cse.c (new_basic_block), dbxout.c (dbxout_type), diagnostic.c
	(init_output_buffer, set_diagnostic_context), dwarf2out.c
	(equate_decl_number_to_die, build_abbrev_table), emit-rtl.c
	(init_emit_once), fold-const.c (mul_double, div_and_round_double),
	function.c (assign_parms), gcse.c (compute_can_copy,
	alloc_gcse_mem, alloc_reg_set_mem, record_one_set,
	compute_hash_table, compute_set_hash_table,
	compute_expr_hash_table), genattrtab.c (optimize_attrs), global.c
	(global_alloc, global_conflicts), haifa-sched.c (compute_trg_info,
	clear_units, schedule_block), integrate.c (initialize_for_inline,
	expand_inline_function), jump.c (thread_jumps), local-alloc.c
	(local_alloc), loop.c (combine_movables, count_loop_regs_set,
	load_mems_and_recount_loop_regs_set), print-tree.c (debug_tree),
	regclass.c (init_reg_sets, init_reg_sets_1, regclass,
	record_reg_classes, allocate_reg_info), reload.c
	(get_secondary_mem, remove_address_replacements, find_reloads),
	reload1.c (reload, set_initial_label_offsets, finish_spills,
	reload_as_needed, choose_reload_regs_init,
	reload_cse_simplify_operands), reorg.c (dbr_schedule), sbitmap.c
	(sbitmap_zero), simplify-rtx.c (simplify_plus_minus), ssa.c
	(rename_registers), stmt.c (expand_end_case), unroll.c
	(unroll_loop), varray.c (varray_grow), objc/objc-act.c: Use memset
	() instead of bzero ().

ch:
	* actions.c (check_missing_cases), typeck.c (build_chill_slice,
	build_chill_cast): Use memset () instead of bzero ().

cp:
	* class.c (duplicate_tag_error, build_vtbl_initializer), decl.c
	(push_binding_level), error.c (cp_tree_printer), pt.c
	(process_partial_specialization, tsubst_template_arg_vector),
	search.c (lookup_member): Use memset () instead of bzero ().

java:
	* expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
	(init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
	instead of bzero ().

From-SVN: r37303
2000-11-07 22:50:06 +00:00
Joseph Myers bf6eb15f68 diagnostic.c: Remove EGCS reference in comment.
* diagnostic.c: Remove EGCS reference in comment.

f:
	* Makefile.in, g77spec.c: Remove EGCS references in comments.

From-SVN: r36996
2000-10-21 19:10:32 +01:00
Richard Henderson 331fe257d6 * diagnostic.c (output_format): Add missing break.
From-SVN: r36739
2000-10-05 18:46:50 -07:00
Gabriel Dos Reis b5dd2c76f8 diagnostic.h (output_clear_message_text): New function.
* diagnostic.h (output_clear_message_text): New function.
	(output_message_text): New macro.

	* diagnostic.c (clear_text_info): Rename to
	output_clear_message_text.
	(output_clear): Adjust.
	(output_finish): Rename to output_finalize_message.  Tweek.
	(output_to_stream): Adjust.

From-SVN: r36658
2000-09-28 12:50:37 +00:00
Branko Cibej 317639a81c flags.h: Declare warning flag warn_system_headers.
2000-09-25  Branko Cibej  <branko.cibej@hermes.si>

        * flags.h:  Declare warning flag warn_system_headers.
        * toplev.c:  Define it.
        (W_options): Add option -Wsystem-headers.
        * diagnostic.c (count_error): Test warn_system_headers.
        * invoke.texi:  Add description for -Wsystem-headers.
	* cpplib.h (cpp_options): New member warn_system_headers.
	* cpphash.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Don't test
	CPP_IN_SYSTEM_HEADER.
	* cpplib.c (do_import, do_pragma_once): Likewise.
	* cpperror.c (_cpp_begin_message): Test warn_system_headers
	and CPP_IN_SYSTEM_HEADER.
	* cppinit.c (handle_option): Recognize -Wsystem_headers.
	(print_help): Describe -Wsystem_headers.
	* cpplex.c (lex_line): Reorganize condition so that warnings
	about C++ comments in system headers can be enabled. Remove
	label do_line_comment.

From-SVN: r36636
2000-09-25 22:54:04 +00:00
Gabriel Dos Reis 4b40f7588e diagnostic.c (output_last_position): Define.
* diagnostic.c (output_last_position): Define.
	(set_real_maximum_length): Tweek.
	* diagnostic.h (output_last_position): Declare.

From-SVN: r36629
2000-09-25 21:20:19 +00:00
Gabriel Dos Reis e651302389 toplev.c (display_help): Fix thinko in documentation.
* toplev.c (display_help): Fix thinko in documentation.

	* diagnostic.h (output_buffer::indent_skip): New fields.
	(output_indentation): New macro.

	* diagnostic.c (output_indent): New function.
	(output_set_prefix, clear_diagnostic_info): Use.
	(output_emit_prefix): Predict future indentation.

From-SVN: r36205
2000-09-06 18:43:35 +00:00
Gabriel Dos Reis 2ab99c469c diagnostic.c (finish_diagnostic): Define.
* diagnostic.c (finish_diagnostic): Define.
	(output_do_printf): Use wrap_text instead of output_add_string.
	(default_print_error_function): Avoid embedded '\n'.

	* diagnostic.h (flush_diagnostic_buffer): Declare.

cp/
	* error.c (print_instantiation_context): Don't forget to flush the
	buffer.

From-SVN: r35939
2000-08-24 08:30:02 +00:00
Gabriel Dos Reis f6a542dece diagnostic.h (output_buffer_state): New macro.
* diagnostic.h (output_buffer_state): New macro.
	* diagnostic.c (diagnostic_for_decl, sorry,
	default_print_error_function, output_do_verbatim,
	report_diagnostic, report_problematic_module): Use it.
	(wrap_text): Tweak.
	(output_format): Use wrap_text instead of maybe_wrap_text.

From-SVN: r35891
2000-08-22 20:20:32 +00:00
Gabriel Dos Reis b413d64ded diagnostic.h (report_problematic_module): Declare.
2000-08-22  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.h (report_problematic_module): Declare.
	* diagnostic.c (report_problematic_module): New function.
	(report_error_function): Tweak.

From-SVN: r35866
2000-08-22 06:54:54 +00:00
Gabriel Dos Reis 24805e803b diagnostic.c (context_as_prefix): Export.
* diagnostic.c (context_as_prefix): Export.
	(need_error_newline): Remove.
	(lang_diagnostic_starter, lang_diagnostic_finalizer): New objects.
	(error_module_changed, record_last_error_module,
	error_function_changed, record_last_error_function): New functions.
	(initialize_diagnostics): Default intialize
	lang_diagnostic_starter, lang_diagnostic_finalizer.
	(init_output_buffer): Tweak.
	(file_name_as_prefix): New function.
	(announce_function, default_print_error_function,
	report_error_function, set_diagnostic_context): Tweak.

cp/
	* lex.c (lang_init_options): Default diagnostic message maximum
	length to 80, when line-wrapping.

From-SVN: r35836
2000-08-21 10:14:18 +00:00
Gabriel Dos Reis e2840263c7 c-errors.c (pedwarn_c99): Adjust call to report_diagnostic.
* c-errors.c (pedwarn_c99): Adjust call to report_diagnostic.

	* diagnostic.c (default_diagnostic_starter,
	default_diagnostic_finalizer): New functions.
	(diagnostic_for_asm, diagnostic_for_decl): Tweak.
	(pedwarn, pedwarn_with_file_and_line, error,
	error_with_file_and_line, fatal, warning,
	warning_with_file_and_line): Adjust call to report_diagnostic.
	(report_diagnostic): Rework.
	(set_diagnostic_context): New function.

	* diagnostic.h (struct diagnostic_context): New data structure.
	(diagnostic_message, diagnostic_argument_list,
	diagnostic_file_location, diagnostic_line_location,
	diagnostic_is_warning, diagnostic_starter, diagnostic_finalizer,
	diagnostic_finalizer, diagnostic_auxiliary_data): New macros.
	(set_diagnostic_context): Declare.
	(report_diagnostic): Change prototype.

From-SVN: r35817
2000-08-20 09:50:12 +00:00
Richard Kenner 43b45e9412 diagnostic.c (fatal_function): New variable.
* diagnostic.c (fatal_function): New variable.
	(set_fatal_function): New function.
	(fatal): Call it.
	* diagnostic.h (set_fatal_function): New declaration.

From-SVN: r35731
2000-08-15 17:21:12 -04:00