gcc/gcc/diagnostic.c

795 lines
24 KiB
C
Raw Normal View History

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 21:35:45 +02:00
/* Language-independent diagnostic subroutines for the GNU Compiler Collection
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-30 00:56:07 +02:00
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
Make-lang.in, [...]: Update copyright years. * ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h, collect2.h, config/alpha/alpha.c, config/alpha/alpha.md, config/alpha/predicates.md, config/arm/arm.md, config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c, config/darwin9.h, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h, config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c, config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c, config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c, config/mips/mips.md, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md, config/rs6000/aix.h, config/rs6000/dfp.md, config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c, config/rs6000/vector.md, config/rtems.h, config/rx/rx.md, config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md, config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c, config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in, c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c, diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi, doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi, doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c, fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h, gensupport.c, gimple.h, gimple-iterator.c, graphite.c, graphite-clast-to-gimple.c, graphite-clast-to-gimple.h, graphite-dependences.c, graphite-poly.c, graphite-poly.h, graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c, graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c, intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h, ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c, ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c, loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c, objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk, opt-functions.awk, opth-gen.awk, params.def, passes.c, postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h, rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h, store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c, tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h, tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c, tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c, unwind-dw2-fde-darwin.c, varpool.c: Update copyright years. From-SVN: r157950
2010-04-02 21:54:46 +02:00
2009, 2010 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
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 16:35:51 +02:00
This file is part of GCC.
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 16:35:51 +02:00
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
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 16:35:51 +02:00
version.
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 16:35:51 +02:00
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* This file implements the language independent aspect of diagnostic
message module. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "version.h"
#include "input.h"
#include "toplev.h"
#include "intl.h"
#include "diagnostic.h"
#define pedantic_warning_kind(DC) \
((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
#define permissive_error_kind(DC) ((DC)->permissive ? DK_WARNING : DK_ERROR)
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
#define permissive_error_option(DC) ((DC)->opt_permissive)
/* Prototypes. */
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 11:52:32 +02:00
static char *build_message_string (const char *, ...) ATTRIBUTE_PRINTF_1;
static void error_recursion (diagnostic_context *) ATTRIBUTE_NORETURN;
static void diagnostic_action_after_output (diagnostic_context *,
diagnostic_info *);
static void real_abort (void) ATTRIBUTE_NORETURN;
/* A diagnostic_context surrogate for stderr. */
static diagnostic_context global_diagnostic_context;
diagnostic_context *global_dc = &global_diagnostic_context;
/* Return a malloc'd string containing MSG formatted a la printf. The
caller is responsible for freeing the memory. */
static char *
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-18 00:21:35 +02:00
build_message_string (const char *msg, ...)
{
char *str;
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-18 00:21:35 +02:00
va_list ap;
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-18 00:21:35 +02:00
va_start (ap, msg);
vasprintf (&str, msg, ap);
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-18 00:21:35 +02:00
va_end (ap);
return str;
}
/* Same as diagnostic_build_prefix, but only the source FILE is given. */
char *
file_name_as_prefix (const char *f)
{
return build_message_string ("%s: ", f);
}
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 21:35:45 +02:00
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 21:35:45 +02:00
/* Initialize the diagnostic message outputting machinery. */
void
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
diagnostic_initialize (diagnostic_context *context, int n_opts)
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 21:35:45 +02:00
{
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
int i;
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 11:52:32 +02:00
/* Allocate a basic pretty-printer. Clients will replace this a
much more elaborated pretty-printer if they wish. */
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
context->printer = XNEW (pretty_printer);
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 11:52:32 +02:00
pp_construct (context->printer, NULL, 0);
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 21:35:45 +02:00
/* By default, diagnostics are sent to stderr. */
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 11:52:32 +02:00
context->printer->buffer->stream = stderr;
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 21:35:45 +02:00
/* By default, we emit prefixes once per message. */
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-07-01 01:09:06 +02:00
context->printer->wrapping.rule = DIAGNOSTICS_SHOW_PREFIX_ONCE;
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 21:35:45 +02:00
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 11:52:32 +02:00
memset (context->diagnostic_count, 0, sizeof context->diagnostic_count);
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
context->some_warnings_are_errors = false;
context->warning_as_error_requested = false;
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
context->n_opts = n_opts;
context->classify_diagnostic = XNEWVEC (diagnostic_t, n_opts);
for (i = 0; i < n_opts; i++)
context->classify_diagnostic[i] = DK_UNSPECIFIED;
context->show_option_requested = false;
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 11:52:32 +02:00
context->abort_on_error = false;
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
context->show_column = false;
context->pedantic_errors = false;
context->permissive = false;
context->opt_permissive = 0;
context->fatal_errors = false;
context->inhibit_warnings = false;
context->warn_system_headers = false;
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 11:52:32 +02:00
context->internal_error = NULL;
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 21:35:45 +02:00
diagnostic_starter (context) = default_diagnostic_starter;
diagnostic_finalizer (context) = default_diagnostic_finalizer;
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
context->option_enabled = NULL;
context->option_name = NULL;
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 11:52:32 +02:00
context->last_module = 0;
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-22 00:34:26 +02:00
context->x_data = NULL;
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 11:52:32 +02:00
context->lock = 0;
context->inhibit_notes_p = false;
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 21:35:45 +02:00
}
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
/* Do any cleaning up required after the last diagnostic is emitted. */
void
diagnostic_finish (diagnostic_context *context)
{
/* Some of the errors may actually have been warnings. */
if (context->some_warnings_are_errors)
{
/* -Werror was given. */
if (context->warning_as_error_requested)
pp_verbatim (context->printer,
_("%s: all warnings being treated as errors\n"),
progname);
/* At least one -Werror= was given. */
else
pp_verbatim (context->printer,
_("%s: some warnings being treated as errors\n"),
progname);
pp_flush (context->printer);
}
}
/* Initialize DIAGNOSTIC, where the message MSG has already been
translated. */
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 21:35:45 +02:00
void
diagnostic_set_info_translated (diagnostic_info *diagnostic, const char *msg,
va_list *args, location_t location,
diagnostic_t kind)
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 21:35:45 +02:00
{
diagnostic->message.err_no = errno;
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 21:35:45 +02:00
diagnostic->message.args_ptr = args;
diagnostic->message.format_spec = msg;
diagnostic->location = location;
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-30 00:56:07 +02:00
diagnostic->override_column = 0;
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 21:35:45 +02:00
diagnostic->kind = kind;
diagnostic->option_index = 0;
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 21:35:45 +02:00
}
/* Initialize DIAGNOSTIC, where the message GMSGID has not yet been
translated. */
void
diagnostic_set_info (diagnostic_info *diagnostic, const char *gmsgid,
va_list *args, location_t location,
diagnostic_t kind)
{
diagnostic_set_info_translated (diagnostic, _(gmsgid), args, location, kind);
}
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 21:35:45 +02:00
/* Return a malloc'd string describing a location. The caller is
responsible for freeing the memory. */
char *
diagnostic_build_prefix (diagnostic_context *context,
diagnostic_info *diagnostic)
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 21:35:45 +02:00
{
static const char *const diagnostic_kind_text[] = {
#define DEFINE_DIAGNOSTIC_KIND(K, T) (T),
#include "diagnostic.def"
#undef DEFINE_DIAGNOSTIC_KIND
"must-not-happen"
};
const char *text = _(diagnostic_kind_text[diagnostic->kind]);
expanded_location s = expand_location (diagnostic->location);
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-30 00:56:07 +02:00
if (diagnostic->override_column)
s.column = diagnostic->override_column;
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 09:47:45 +02:00
gcc_assert (diagnostic->kind < DK_LAST_DIAGNOSTIC_KIND);
return
(s.file == NULL
? build_message_string ("%s: %s", progname, text)
: context->show_column
? build_message_string ("%s:%d:%d: %s", s.file, s.line, s.column, text)
: build_message_string ("%s:%d: %s", s.file, s.line, text));
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 21:35:45 +02:00
}
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 20:32:18 +02:00
/* Take any action which is expected to happen after the diagnostic
is written out. This function does not always return. */
static void
diagnostic_action_after_output (diagnostic_context *context,
diagnostic_info *diagnostic)
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 20:32:18 +02:00
{
switch (diagnostic->kind)
{
case DK_DEBUG:
case DK_NOTE:
case DK_ANACHRONISM:
case DK_WARNING:
break;
case DK_ERROR:
case DK_SORRY:
if (context->abort_on_error)
real_abort ();
if (context->fatal_errors)
{
fnotice (stderr, "compilation terminated due to -Wfatal-errors.\n");
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
diagnostic_finish (context);
exit (FATAL_EXIT_CODE);
}
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 20:32:18 +02:00
break;
case DK_ICE:
if (context->abort_on_error)
real_abort ();
fnotice (stderr, "Please submit a full bug report,\n"
"with preprocessed source if appropriate.\n"
"See %s for instructions.\n", bug_report_url);
exit (ICE_EXIT_CODE);
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 20:32:18 +02:00
case DK_FATAL:
if (context->abort_on_error)
real_abort ();
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
diagnostic_finish (context);
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 20:32:18 +02:00
fnotice (stderr, "compilation terminated.\n");
exit (FATAL_EXIT_CODE);
default:
gcc_unreachable ();
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 20:32:18 +02:00
}
}
void
diagnostic_report_current_module (diagnostic_context *context)
{
const struct line_map *map;
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 11:52:32 +02:00
if (pp_needs_newline (context->printer))
{
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 11:52:32 +02:00
pp_newline (context->printer);
pp_needs_newline (context->printer) = false;
}
if (input_location <= BUILTINS_LOCATION)
return;
map = linemap_lookup (line_table, input_location);
if (map && diagnostic_last_module_changed (context, map))
{
diagnostic_set_last_module (context, map);
if (! MAIN_FILE_P (map))
{
map = INCLUDED_FROM (line_table, map);
if (context->show_column)
diagnostic.c (diagnostic_build_prefix): Always print columns. gcc/ * diagnostic.c (diagnostic_build_prefix): Always print columns. (diagnostic_report_current_module): Print columns. * common.opt (flag_show_column): Enable by default. gcc/testsuite/ * lib/gcc-dg.exp (dg-bogus): Override dg-bogus. (process-message): Expect column numbers. * gcc.dg/va-arg-2.c: Use line 0 to indicate no column. * gcc.dg/pch/counter-2.c: Same. * gcc.dg/pch/valid-2.c: Same. * gcc.dg/pch/warn-1.c: Same. * gcc.dg/pch/valid-1.c: Same. * gcc.dg/cpp/include2a.c: Handle lack of columns. * gcc.dg/cpp/syshdr.c: Same. * gcc.dg/cpp/19940712-1.c: Same. * gcc.dg/cpp/missing-header-1.c: Same. * gcc.dg/cpp/unc4.c: Remove -fno-show-column. * gcc.dg/cpp/tr-warn3.c: Same. * gcc.dg/cpp/pr29612-2.c: Same. * gcc.dg/cpp/tr-warn4.c: Same. * gcc.dg/cpp/Wtrigraphs.c: Same. * gcc.dg/cpp/poison.c: Same. * gcc.dg/cpp/arith-3.c: Same. * gcc.dg/cpp/sysmac2.c: Same. * gcc.dg/cpp/cpp.exp: Same. * gcc.dg/cpp/tr-warn5.c: Same. * gcc.dg/cpp/include2.c: Same. * gcc.dg/cpp/Wmissingdirs.c: Same. * gcc.dg/cpp/Wmissingdirs.c: Same. * gcc.dg/cpp/tr-warn6.c: Same. * gcc.dg/cpp/Wtrigraphs-2.c: Same. * gcc.dg/cpp/macspace1.c: Same. * gcc.dg/cpp/escape-2.c: Same. * gcc.dg/cpp/assert2.c: Same. * gcc.dg/cpp/undef2.c: Same. * gcc.dg/cpp/macspace2.c: Same. * gcc.dg/cpp/tr-warn1.c: Same. * gcc.dg/cpp/extratokens2.c: Same. * gcc.dg/cpp/strify2.c: Same. * gcc.dg/cpp/Wsignprom.c: Same. * gcc.dg/cpp/redef2.c: Same. * gcc.dg/cpp/trad/trad.exp: Same. * gcc.dg/cpp/arith-1.c: Same. * gcc.dg/cpp/extratokens.c: Same. * gcc.dg/cpp/if-mpar.c: Same. gcc/cp/ * error.c (print_instantiation_partial_context): Print column numbers. libcpp/ * include/line-map.h (LAST_SOURCE_COLUMN): New. From-SVN: r148052
2009-06-01 18:09:33 +02:00
pp_verbatim (context->printer,
"In file included from %s:%d:%d",
map->to_file,
LAST_SOURCE_LINE (map), LAST_SOURCE_COLUMN (map));
else
pp_verbatim (context->printer,
"In file included from %s:%d",
map->to_file, LAST_SOURCE_LINE (map));
while (! MAIN_FILE_P (map))
{
map = INCLUDED_FROM (line_table, map);
pp_verbatim (context->printer,
",\n from %s:%d",
map->to_file, LAST_SOURCE_LINE (map));
}
pp_verbatim (context->printer, ":");
pp_newline (context->printer);
}
}
}
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 23:44:12 +01:00
[multiple changes] 2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-09-03 06:07:12 +02:00
void
default_diagnostic_starter (diagnostic_context *context,
diagnostic_info *diagnostic)
{
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-22 00:34:26 +02:00
diagnostic_report_current_module (context);
pp_set_prefix (context->printer, diagnostic_build_prefix (context,
diagnostic));
}
[multiple changes] 2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-09-03 06:07:12 +02:00
void
default_diagnostic_finalizer (diagnostic_context *context,
diagnostic_info *diagnostic ATTRIBUTE_UNUSED)
{
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 11:52:32 +02:00
pp_destroy_prefix (context->printer);
}
/* Interface to specify diagnostic kind overrides. Returns the
previous setting, or DK_UNSPECIFIED if the parameters are out of
range. */
diagnostic_t
diagnostic_classify_diagnostic (diagnostic_context *context,
int option_index,
diagnostic_t new_kind)
{
diagnostic_t old_kind;
if (option_index <= 0
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
|| option_index >= context->n_opts
|| new_kind >= DK_LAST_DIAGNOSTIC_KIND)
return DK_UNSPECIFIED;
old_kind = context->classify_diagnostic[option_index];
context->classify_diagnostic[option_index] = new_kind;
return old_kind;
}
/* Report a diagnostic message (an error or a warning) as specified by
DC. This function is *the* subroutine in terms of which front-ends
should implement their specific diagnostic handling modules. The
front-end independent format specifiers are exactly those described
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
in the documentation of output_format.
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-09 01:57:19 +02:00
Return true if a diagnostic was printed, false otherwise. */
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 23:44:12 +01:00
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-09 01:57:19 +02:00
bool
diagnostic_report_diagnostic (diagnostic_context *context,
diagnostic_info *diagnostic)
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 23:44:12 +01:00
{
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 16:29:27 +02:00
location_t location = diagnostic->location;
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
diagnostic_t orig_diag_kind = diagnostic->kind;
const char *saved_format_spec;
/* Give preference to being able to inhibit warnings, before they
get reclassified to something else. */
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-09 01:57:19 +02:00
if ((diagnostic->kind == DK_WARNING || diagnostic->kind == DK_PEDWARN)
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
&& !diagnostic_report_warnings_p (context, location))
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-09 01:57:19 +02:00
return false;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (diagnostic->kind == DK_PEDWARN)
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
{
diagnostic->kind = pedantic_warning_kind (context);
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
/* We do this to avoid giving the message for -pedantic-errors. */
orig_diag_kind = diagnostic->kind;
}
if (diagnostic->kind == DK_NOTE && context->inhibit_notes_p)
return false;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (context->lock > 0)
{
/* If we're reporting an ICE in the middle of some other error,
try to flush out the previous error, then let this one
through. Don't do this more than once. */
if (diagnostic->kind == DK_ICE && context->lock == 1)
pp_flush (context->printer);
else
error_recursion (context);
}
/* If the user requested that warnings be treated as errors, so be
it. Note that we do this before the next block so that
individual warnings can be overridden back to warnings with
-Wno-error=*. */
if (context->warning_as_error_requested
&& diagnostic->kind == DK_WARNING)
{
diagnostic->kind = DK_ERROR;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (diagnostic->option_index)
{
/* This tests if the user provided the appropriate -Wfoo or
-Wno-foo option. */
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
if (! context->option_enabled (diagnostic->option_index))
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-09 01:57:19 +02:00
return false;
/* This tests if the user provided the appropriate -Werror=foo
option. */
if (context->classify_diagnostic[diagnostic->option_index] != DK_UNSPECIFIED)
{
diagnostic->kind = context->classify_diagnostic[diagnostic->option_index];
}
/* This allows for future extensions, like temporarily disabling
warnings for ranges of source code. */
if (diagnostic->kind == DK_IGNORED)
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-09 01:57:19 +02:00
return false;
}
re PR other/42965 (no "warnings being treated as errors" for individual -Werror=x options) 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 42965 * diagnostic.c (diagnostic_initialize): Initialize some_warnings_are_errors. (diagnostic_finish): New. (diagnostic_action_after_output): Call it before exiting. (diagnostic_report_diagnostic): Do not print message here. Set some_warnings_are_errors. * diagnostic.h (diagnostic_context): Delete issue_warnings_are_errors_message. Add some_warnings_are_errors. (diagnostic_finish): Declare. * toplev.c (toplev_main): Call it before exit. testsuite/ * gcc.dg/Werror-6.c: Adjust. * gcc.dg/Werror-implicit-function-declaration.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Wdeclaration-after-statement-3.c: Likewise. * gcc.dg/Wswitch-enum-error.c: Likewise. * gcc.dg/Wpointer-arith.c: Likewise. * gcc.dg/Wfatal.c: Likewise. * gcc.dg/Wswitch-error.c: Likewise. * g++.dg/warn/unused-result1-Werror.c: Likewise. * gcc.dg/Werror-9.c: Delete. Duplicate of Werror-4.c. * gcc.dg/cpp/warn-undef-2.c: Likewise. * gcc.dg/cpp/warn-traditional-2.c: Likewise. * gcc.dg/cpp/warn-comments-2.c: Likewise. * gcc.dg/cpp/warn-variadic-2.c: Likewise. * gcc.dg/cpp/warning-directive-2.c: Likewise. * gcc.dg/cpp/warn-long-long-2.c: Likewise. * gcc.dg/cpp/warn-deprecated-2.c: Likewise. * gcc.dg/cpp/warn-multichar-2.c: Likewise. * gcc.dg/cpp/warn-normalized-3.c: Likewise. * gcc.dg/cpp/warn-cxx-compat-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-3.c: Likewise. * gcc.dg/cpp/warn-unused-macros-2.c: Likewise. * gcc.dg/cpp/warn-trigraphs-4.c: Likewise. * gcc.dg/cpp/warn-redefined-2.c: Likewise. * g++.dg/cpp/warning-directive-2.C: Likewise. * gfortran.dg/warning-directive-2.F90: Likewise. From-SVN: r158168
2010-04-09 17:45:52 +02:00
if (orig_diag_kind == DK_WARNING && diagnostic->kind == DK_ERROR)
context->some_warnings_are_errors = true;
context->lock++;
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 23:44:12 +01:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (diagnostic->kind == DK_ICE)
{
#ifndef ENABLE_CHECKING
/* When not checking, ICEs are converted to fatal errors when an
error has already occurred. This is counteracted by
abort_on_error. */
if ((diagnostic_kind_count (context, DK_ERROR) > 0
|| diagnostic_kind_count (context, DK_SORRY) > 0)
&& !context->abort_on_error)
{
expanded_location s = expand_location (diagnostic->location);
fnotice (stderr, "%s:%d: confused by earlier errors, bailing out\n",
s.file, s.line);
exit (ICE_EXIT_CODE);
}
#endif
if (context->internal_error)
(*context->internal_error) (context,
diagnostic->message.format_spec,
diagnostic->message.args_ptr);
}
++diagnostic_kind_count (context, diagnostic->kind);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
saved_format_spec = diagnostic->message.format_spec;
if (context->show_option_requested)
{
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
char *option_text;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
option_text = context->option_name (context, diagnostic->option_index,
orig_diag_kind, diagnostic->kind);
if (option_text)
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
{
diagnostic->message.format_spec
= ACONCAT ((diagnostic->message.format_spec,
" ",
"[", option_text, "]",
NULL));
free (option_text);
}
}
diagnostic->message.locus = &diagnostic->location;
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-22 00:34:26 +02:00
diagnostic->message.x_data = &diagnostic->x_data;
diagnostic->x_data = NULL;
pp_format (context->printer, &diagnostic->message);
(*diagnostic_starter (context)) (context, diagnostic);
pp_output_formatted_text (context->printer);
(*diagnostic_finalizer (context)) (context, diagnostic);
pp_flush (context->printer);
diagnostic_action_after_output (context, diagnostic);
diagnostic->message.format_spec = saved_format_spec;
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-22 00:34:26 +02:00
diagnostic->x_data = NULL;
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 20:32:18 +02:00
context->lock--;
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-09 01:57:19 +02:00
return true;
}
/* Given a partial pathname as input, return another pathname that
shares no directory elements with the pathname of __FILE__. This
is used by fancy_abort() to print `Internal compiler error in expr.c'
instead of `Internal compiler error in ../../GCC/gcc/expr.c'. */
const char *
trim_filename (const char *name)
{
static const char this_file[] = __FILE__;
const char *p = name, *q = this_file;
/* First skip any "../" in each filename. This allows us to give a proper
reference to a file in a subdirectory. */
while (p[0] == '.' && p[1] == '.' && IS_DIR_SEPARATOR (p[2]))
p += 3;
while (q[0] == '.' && q[1] == '.' && IS_DIR_SEPARATOR (q[2]))
q += 3;
/* Now skip any parts the two filenames have in common. */
while (*p == *q && *p != 0 && *q != 0)
p++, q++;
/* Now go backwards until the previous directory separator. */
while (p > name && !IS_DIR_SEPARATOR (p[-1]))
p--;
return p;
}
/* Standard error reporting routines in increasing order of severity.
All of these take arguments like printf. */
/* Text to be emitted verbatim to the error message stream; this
produces no prefix and disables line-wrapping. Use rarely. */
void
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
verbatim (const char *gmsgid, ...)
{
text_info text;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
text.err_no = errno;
text.args_ptr = &ap;
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
text.format_spec = _(gmsgid);
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-07-01 01:09:06 +02:00
text.locus = NULL;
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-22 00:34:26 +02:00
text.x_data = NULL;
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 11:52:32 +02:00
pp_format_verbatim (global_dc->printer, &text);
pp_flush (global_dc->printer);
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-18 00:21:35 +02:00
va_end (ap);
}
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-09 01:57:19 +02:00
bool
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
emit_diagnostic (diagnostic_t kind, location_t location, int opt,
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-09 01:57:19 +02:00
const char *gmsgid, ...)
{
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 21:35:45 +02:00
diagnostic_info diagnostic;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
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-09 01:57:19 +02:00
if (kind == DK_PERMERROR)
{
diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
permissive_error_kind (global_dc));
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
diagnostic.option_index = permissive_error_option (global_dc);
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-09 01:57:19 +02:00
}
else {
diagnostic_set_info (&diagnostic, gmsgid, &ap, location, kind);
if (kind == DK_WARNING || kind == DK_PEDWARN)
diagnostic.option_index = opt;
}
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-18 00:21:35 +02:00
va_end (ap);
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-09 01:57:19 +02:00
return report_diagnostic (&diagnostic);
}
/* An informative note at LOCATION. Use this for additional details on an error
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-09 01:57:19 +02:00
message. */
void
inform (location_t location, const char *gmsgid, ...)
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 23:29:07 +02:00
{
diagnostic_info diagnostic;
va_list ap;
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
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_NOTE);
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 23:29:07 +02:00
report_diagnostic (&diagnostic);
va_end (ap);
}
/* An informative note at LOCATION. Use this for additional details on an
error message. */
void
inform_n (location_t location, int n, const char *singular_gmsgid,
const char *plural_gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, plural_gmsgid);
diagnostic_set_info_translated (&diagnostic,
ngettext (singular_gmsgid, plural_gmsgid, n),
&ap, location, DK_NOTE);
report_diagnostic (&diagnostic);
va_end (ap);
}
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-09 01:57:19 +02:00
/* A warning at INPUT_LOCATION. Use this for code which is correct according
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
to the relevant language specification but is likely to be buggy anyway.
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-09 01:57:19 +02:00
Returns true if the warning was printed, false if it was inhibited. */
bool
warning (int opt, const char *gmsgid, ...)
{
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 21:35:45 +02:00
diagnostic_info diagnostic;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING);
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-09 01:57:19 +02:00
diagnostic.option_index = opt;
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-18 00:21:35 +02:00
va_end (ap);
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-09 01:57:19 +02:00
return report_diagnostic (&diagnostic);
}
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 16:29:27 +02:00
/* A warning at LOCATION. Use this for code which is correct according to the
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-09 01:57:19 +02:00
relevant language specification but is likely to be buggy anyway.
Returns true if the warning was printed, false if it was inhibited. */
bool
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 16:29:27 +02:00
warning_at (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_WARNING);
diagnostic.option_index = opt;
va_end (ap);
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-09 01:57:19 +02:00
return report_diagnostic (&diagnostic);
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 16:29:27 +02:00
}
/* A "pedantic" warning at LOCATION: issues a warning unless
-pedantic-errors was given on the command line, in which case it
issues an error. Use this for diagnostics required by the relevant
language standard, if you have chosen not to make them errors.
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 20:32:18 +02:00
Note that these diagnostics are issued independent of the setting
of the -pedantic command-line switch. To get a warning enabled
only with that switch, use either "if (pedantic) pedwarn
(OPT_pedantic,...)" or just "pedwarn (OPT_pedantic,..)". To get a
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-09 01:57:19 +02:00
pedwarn independently of the -pedantic switch use "pedwarn (0,...)".
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-09 01:57:19 +02:00
Returns true if the warning was printed, false if it was inhibited. */
bool
pedwarn (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_PEDWARN);
diagnostic.option_index = opt;
va_end (ap);
return report_diagnostic (&diagnostic);
}
/* A "permissive" error at LOCATION: issues an error unless
-fpermissive was given on the command line, in which case it issues
a warning. Use this for things that really should be errors but we
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-09 01:57:19 +02:00
want to support legacy code.
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-09 01:57:19 +02:00
Returns true if the warning was printed, false if it was inhibited. */
bool
permerror (location_t location, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
permissive_error_kind (global_dc));
diagnostic.c: Don't include opts.h. * diagnostic.c: Don't include opts.h. (permissive_error_option): Define. (diagnostic_initialize): Take n_opts parameter. Allocate memory for classify_diagnostic. Don't use memset for classify_diagnostic. Initialize new and recently added fields. (diagnostic_classify_diagnostic): Use context->n_opts instead of N_OPTS. (diagnostic_report_diagnostic): Pass context parameter to diagnostic_report_warnings_p. Use option_enabled and option_name hooks from context. (emit_diagnostic): Use permissive_error_option. (permerror): Likewise. * diagnostic.h: Don't include options.h. (struct diagnostic_context): Add n_opts, opt_permissive, inhibit_warnings, warn_system_headers, option_enabled and option_name fields. Change classify_diagnostic to a pointer. * opts-diagnostic.h: New file. * opts.c: Include opts-diagnostic.h. (common_handle_option): Set global_dc fields for -Wfatal-errors, -Wsystem-headers, -fshow-column, -pedantic-errors and -w. (option_name): New function. * c-opts.c (c_common_init_options): Set global_dc->opt_permissive. (c_common_handle_option): Set global_dc->permissive for -fpermissive. * c-common.c (c_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. * toplev.c: Include opts-diagnostic.h. (general_init): Update call to diagnostic_initialize. Set global_dc->show_column, global_dc->option_enabled and global_dc->option_name. (process_options): Don't set global_dc fields here. * Makefile.in (DIAGNOSTIC_H): Remove options.h. (diagnostic.o, opts.o, toplev.o): Update dependencies. fortran: * cpp.c (cb_cpp_error): Save and restore global_dc->warn_system_headers, not variable warn_system_headers. From-SVN: r159869
2010-05-26 15:40:53 +02:00
diagnostic.option_index = permissive_error_option (global_dc);
va_end (ap);
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-09 01:57:19 +02:00
return report_diagnostic (&diagnostic);
}
/* A hard error: the code is definitely ill-formed, and an object file
will not be produced. */
void
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
error (const char *gmsgid, ...)
{
diagnostic_info diagnostic;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ERROR);
report_diagnostic (&diagnostic);
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-18 00:21:35 +02:00
va_end (ap);
}
/* A hard error: the code is definitely ill-formed, and an object file
will not be produced. */
void
error_n (location_t location, int n, const char *singular_gmsgid,
const char *plural_gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, plural_gmsgid);
diagnostic_set_info_translated (&diagnostic,
ngettext (singular_gmsgid, plural_gmsgid, n),
&ap, location, DK_ERROR);
report_diagnostic (&diagnostic);
va_end (ap);
}
/* Same as ebove, but use location LOC instead of input_location. */
void
error_at (location_t loc, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, loc, DK_ERROR);
report_diagnostic (&diagnostic);
va_end (ap);
}
/* "Sorry, not implemented." Use for a language feature which is
required by the relevant specification but not implemented by GCC.
An object file will not be produced. */
void
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
sorry (const char *gmsgid, ...)
{
diagnostic_info diagnostic;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_SORRY);
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 20:32:18 +02:00
report_diagnostic (&diagnostic);
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-18 00:21:35 +02:00
va_end (ap);
}
/* An error which is severe enough that we make no attempt to
continue. Do not use this for internal consistency checks; that's
internal_error. Use of this function should be rare. */
void
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
fatal_error (const char *gmsgid, ...)
{
diagnostic_info diagnostic;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_FATAL);
report_diagnostic (&diagnostic);
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-18 00:21:35 +02:00
va_end (ap);
gcc_unreachable ();
}
/* An internal consistency check has failed. We make no attempt to
continue. Note that unless there is debugging value to be had from
a more specific message, or some other good reason, you should use
abort () instead of calling this function directly. */
void
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
internal_error (const char *gmsgid, ...)
{
diagnostic_info diagnostic;
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ICE);
report_diagnostic (&diagnostic);
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-18 00:21:35 +02:00
va_end (ap);
gcc_unreachable ();
}
/* Special case error functions. Most are implemented in terms of the
above, or should be. */
/* Print a diagnostic MSGID on FILE. This is just fprintf, except it
runs its second argument through gettext. */
void
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
fnotice (FILE *file, const char *cmsgid, ...)
{
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-18 00:21:35 +02:00
va_list ap;
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
va_start (ap, cmsgid);
vfprintf (file, _(cmsgid), ap);
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-18 00:21:35 +02:00
va_end (ap);
}
/* Inform the user that an error occurred while trying to report some
other error. This indicates catastrophic internal inconsistencies,
so give up now. But do try to flush out the previous error.
This mustn't use internal_error, that will cause infinite recursion. */
static void
error_recursion (diagnostic_context *context)
{
diagnostic_info diagnostic;
if (context->lock < 3)
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 11:52:32 +02:00
pp_flush (context->printer);
fnotice (stderr,
"Internal compiler error: Error reporting routines re-entered.\n");
/* Call diagnostic_action_after_output to get the "please submit a bug
report" message. It only looks at the kind field of diagnostic_info. */
diagnostic.kind = DK_ICE;
diagnostic_action_after_output (context, &diagnostic);
/* Do not use gcc_unreachable here; that goes through internal_error
and therefore would cause infinite recursion. */
real_abort ();
}
/* Report an internal compiler error in a friendly manner. This is
the function that gets called upon use of abort() in the source
code generally, thanks to a special macro. */
void
fancy_abort (const char *file, int line, const char *function)
{
internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
}
/* Really call the system 'abort'. This has to go right at the end of
this file, so that there are no functions after it that call abort
and get the system abort instead of our macro. */
#undef abort
static void
real_abort (void)
{
abort ();
}