gcc/gcc/diagnostic.def

51 lines
2.4 KiB
Modula-2
Raw Permalink Normal View History

/* Copyright (C) 2001-2017 Free Software Foundation, Inc.
ABOUT-GCC-NLS, [...]: Add copyright and license notices. * ABOUT-GCC-NLS, ChangeLog, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008, ChangeLog.dataflow, ChangeLog.lib, ChangeLog.ptr, ChangeLog.tree-ssa, ChangeLog.tuples, FSFChangeLog, FSFChangeLog.10, FSFChangeLog.11, LANGUAGES, ONEWS, acinclude.m4, config/alpha/gnu.h, config/alpha/libgcc-alpha-ldbl.ver, config/alpha/t-osf4, config/alpha/t-vms, config/alpha/va_list.h, config/alpha/x-vms, config/arc/t-arc, config/arm/README-interworking, config/arm/arm-c.c, config/arm/gentune.sh, config/arm/libgcc-bpabi.ver, config/arm/t-arm, config/arm/t-arm-elf, config/arm/t-arm-softfp, config/arm/t-bpabi, config/arm/t-linux, config/arm/t-linux-eabi, config/arm/t-netbsd, config/arm/t-pe, config/arm/t-strongarm-elf, config/arm/t-symbian, config/arm/t-vxworks, config/arm/t-wince-pe, config/avr/t-avr, config/bfin/elf.h, config/bfin/libgcc-bfin.ver, config/bfin/linux.h, config/bfin/t-bfin, config/bfin/t-bfin-elf, config/bfin/t-bfin-linux, config/bfin/t-bfin-uclinux, config/bfin/uclinux.h, config/cris/mulsi3.asm, config/cris/t-cris, config/cris/t-elfmulti, config/crx/t-crx, config/darwin-ppc-ldouble-patch.def, config/darwin-sections.def, config/divmod.c, config/fr30/t-fr30, config/frv/libgcc-frv.ver, config/frv/t-frv, config/frv/t-linux, config/h8300/genmova.sh, config/h8300/t-h8300, config/i386/athlon.md, config/i386/darwin-libgcc.10.4.ver, config/i386/darwin-libgcc.10.5.ver, config/i386/libgcc-glibc.ver, config/i386/mach.h, config/i386/netbsd.h, config/i386/t-crtpc, config/i386/t-cygming, config/i386/t-cygwin, config/i386/t-i386, config/i386/t-linux64, config/i386/t-nwld, config/i386/t-rtems-i386, config/i386/t-sol2-10, config/i386/x-mingw32, config/ia64/div.md, config/ia64/elf.h, config/ia64/ia64.opt, config/ia64/libgcc-glibc.ver, config/ia64/libgcc-ia64.ver, config/ia64/linux.h, config/ia64/sysv4.h, config/ia64/t-hpux, config/ia64/t-ia64, config/iq2000/abi, config/iq2000/lib2extra-funcs.c, config/iq2000/t-iq2000, config/libgcc-glibc.ver, config/m32r/libgcc-glibc.ver, config/m32r/t-linux, config/m32r/t-m32r, config/m68hc11/t-m68hc11, config/m68k/t-floatlib, config/m68k/t-linux, config/m68k/t-mlibs, config/m68k/t-uclinux, config/mcore/t-mcore, config/mcore/t-mcore-pe, config/mips/20kc.md, config/mips/4130.md, config/mips/5400.md, config/mips/5500.md, config/mips/crti.asm, config/mips/crtn.asm, config/mips/irix-crti.asm, config/mips/irix-crtn.asm, config/mips/libgcc-mips16.ver, config/mips/mips-dsp.md, config/mips/mips-dspr2.md, config/mips/mips-fixed.md, config/mips/sb1.md, config/mips/sr71k.md, config/mips/t-elf, config/mips/t-gofast, config/mips/t-iris6, config/mips/t-isa3264, config/mips/t-libgcc-mips16, config/mips/t-linux64, config/mips/t-mips, config/mips/t-r3900, config/mips/t-rtems, config/mips/t-sb1, config/mips/t-sde, config/mips/t-sdemtk, config/mips/t-slibgcc-irix, config/mips/t-sr71k, config/mips/t-st, config/mips/t-vr, config/mips/t-vxworks, config/mmix/t-mmix, config/mn10300/t-linux, config/mn10300/t-mn10300, config/pa/pa32-regs.h, config/pa/t-hpux-shlib, config/pa/t-linux, config/pa/t-linux64, config/pa/t-pa64, config/pdp11/t-pdp11, config/picochip/libgccExtras/clzsi2.asm, config/picochip/t-picochip, config/rs6000/darwin-ldouble-format, config/rs6000/darwin-libgcc.10.4.ver, config/rs6000/darwin-libgcc.10.5.ver, config/rs6000/libgcc-ppc-glibc.ver, config/rs6000/ppc-asm.h, config/rs6000/t-aix43, config/rs6000/t-aix52, config/rs6000/t-darwin, config/rs6000/t-fprules, config/rs6000/t-fprules-fpbit, config/rs6000/t-linux64, config/rs6000/t-lynx, config/rs6000/t-netbsd, config/rs6000/t-ppccomm, config/rs6000/t-ppcendian, config/rs6000/t-ppcgas, config/rs6000/t-rs6000, config/rs6000/t-rtems, config/rs6000/t-spe, config/rs6000/t-vxworks, config/s390/libgcc-glibc.ver, config/score/t-score-elf, config/sh/divcost-analysis, config/sh/libgcc-glibc.ver, config/sh/t-netbsd, config/sh/t-sh, config/sh/t-sh64, config/sh/t-superh, config/sh/t-symbian, config/sparc/libgcc-sparc-glibc.ver, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sol2-gld-bi.h, config/sparc/t-elf, config/sparc/t-linux64, config/sparc/t-sol2, config/stormy16/stormy-abi, config/stormy16/t-stormy16, config/t-darwin, config/t-libunwind, config/t-libunwind-elf, config/t-linux, config/t-lynx, config/t-slibgcc-elf-ver, config/t-slibgcc-sld, config/t-sol2, config/t-vxworks, config/udivmod.c, config/udivmodsi4.c, config/v850/t-v850, config/v850/t-v850e, config/xtensa/t-xtensa, diagnostic.def, gdbinit.in, glimits.h, gstab.h, gsyms.h, java/ChangeLog, java/ChangeLog.ptr, java/ChangeLog.tree-ssa, libgcc-std.ver, limitx.h, version.c, xcoff.h: Add copyright and license notices. * config/h8300/genmova.sh: Include copyright and license notices in generated output. * config/h8300/mova.md: Regenerate. * doc/install.texi2html: Include word "Copyright" in copyright notice and use name "Free Software Foundation, Inc.". * ChangeLog, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008: Correct dates. ada: * ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and license notices. cp: * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995, ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999, ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS, cfns.gperf: Add copyright and license notices. * cfns.h: Regenerate. * ChangeLog, ChangeLog-2004: Correct dates. fortran: * ChangeLog, ChangeLog-2002, ChangeLog-2003, ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008, ChangeLog.ptr, config-lang.in, ioparm.def, mathbuiltins.def: Add copyright and license notices. * ChangeLog, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007, ChangeLog-2008: Correct dates. java: * ChangeLog, ChangeLog.ptr, ChangeLog.tree-ssa: Add copyright and license notices. objc: * ChangeLog: Add copyright and license notices. objcp: * ChangeLog: Add copyright and license notices. po: * ChangeLog, EXCLUDES: Add copyright and license notices. testsuite: * ChangeLog, ChangeLog-1993-2007, ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, README, README.QMTEST, README.compat, README.gcc, g++.dg/README, g++.dg/compat/break/README, g++.dg/gomp/gomp.exp, g++.old-deja/g++.brendan/README, g++.old-deja/g++.oliva/ChangeLog, g++.old-deja/g++.robertl/README, gcc.c-torture/ChangeLog.0, gcc.c-torture/execute/builtins/builtins.exp, gcc.dg/README, gcc.dg/gomp/gomp.exp, gcc.target/frv/frv.exp, gcc.target/i386/math-torture/math-torture.exp, gcc.target/mips/inter/mips16-inter.exp, gcc.target/mips/mips-nonpic/README, gcc.target/x86_64/abi/README.gcc, gcc.target/xstormy16/xstormy16.exp, gcc.test-framework/README, gfortran.dg/g77/README, gfortran.dg/gomp/gomp.exp, gfortran.fortran-torture/ChangeLog.g95: Add copyright and license notices. * ChangeLog-1993-2007, ChangeLog: Correct dates. From-SVN: r146533
2009-04-21 21:03:23 +02:00
This file is part of GCC.
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
version.
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/>. */
/* DK_UNSPECIFIED must be first so it has a value of zero. We never
assign this kind to an actual diagnostic, we only use this in
variables that can hold a kind, to mean they have yet to have a
kind specified. I.e. they're uninitialized. Within the diagnostic
machinery, this kind also means "don't change the existing kind",
meaning "no change is specified". */
opts.c: Include diagnostic-color.h. * opts.c: Include diagnostic-color.h. (common_handle_option): Handle OPT_fdiagnostics_color_. * Makefile.in (OBJS-libcommon): Add diagnostic-color.o. (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h. (diagnostic-color.o): New. * common.opt (fdiagnostics-color, fdiagnostics-color=): New options. (diagnostic_color_rule): New enum. * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*. * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around the location string. * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros, either NULL, or color kind. * diagnostic-color.c: New file. * diagnostic-color.h: New file. * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3 arguments. * doc/invoke.texi (-fdiagnostics-color): Document. * pretty-print.h (pp_show_color): Define. (struct pretty_print_info): Add show_color field. * diagnostic.c: Include diagnostic-color.h. (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND macros. Colorize error:, warning: etc. strings and also the location string. (diagnostic_show_locus): Colorize the caret line. * pretty-print.c: Include diagnostic-color.h. (pp_base_format): Handle %r and %R format specifiers. Colorize strings inside of %< %> quotes or quoted through q format modifier. c-family/ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format specifiers. cp/ * error.c (cp_print_error_function, print_instantiation_partial_context_line, maybe_print_constexpr_context): Colorize locus strings. From-SVN: r197841
2013-04-12 08:19:58 +02:00
DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "", NULL)
/* If a diagnostic is set to DK_IGNORED, it won't get reported at all.
This is used by the diagnostic machinery when it wants to disable a
diagnostic without disabling the option which causes it. */
opts.c: Include diagnostic-color.h. * opts.c: Include diagnostic-color.h. (common_handle_option): Handle OPT_fdiagnostics_color_. * Makefile.in (OBJS-libcommon): Add diagnostic-color.o. (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h. (diagnostic-color.o): New. * common.opt (fdiagnostics-color, fdiagnostics-color=): New options. (diagnostic_color_rule): New enum. * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*. * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around the location string. * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros, either NULL, or color kind. * diagnostic-color.c: New file. * diagnostic-color.h: New file. * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3 arguments. * doc/invoke.texi (-fdiagnostics-color): Document. * pretty-print.h (pp_show_color): Define. (struct pretty_print_info): Add show_color field. * diagnostic.c: Include diagnostic-color.h. (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND macros. Colorize error:, warning: etc. strings and also the location string. (diagnostic_show_locus): Colorize the caret line. * pretty-print.c: Include diagnostic-color.h. (pp_base_format): Handle %r and %R format specifiers. Colorize strings inside of %< %> quotes or quoted through q format modifier. c-family/ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format specifiers. cp/ * error.c (cp_print_error_function, print_instantiation_partial_context_line, maybe_print_constexpr_context): Colorize locus strings. From-SVN: r197841
2013-04-12 08:19:58 +02:00
DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "", NULL)
/* The remainder are real diagnostic types. */
opts.c: Include diagnostic-color.h. * opts.c: Include diagnostic-color.h. (common_handle_option): Handle OPT_fdiagnostics_color_. * Makefile.in (OBJS-libcommon): Add diagnostic-color.o. (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h. (diagnostic-color.o): New. * common.opt (fdiagnostics-color, fdiagnostics-color=): New options. (diagnostic_color_rule): New enum. * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*. * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around the location string. * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros, either NULL, or color kind. * diagnostic-color.c: New file. * diagnostic-color.h: New file. * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3 arguments. * doc/invoke.texi (-fdiagnostics-color): Document. * pretty-print.h (pp_show_color): Define. (struct pretty_print_info): Add show_color field. * diagnostic.c: Include diagnostic-color.h. (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND macros. Colorize error:, warning: etc. strings and also the location string. (diagnostic_show_locus): Colorize the caret line. * pretty-print.c: Include diagnostic-color.h. (pp_base_format): Handle %r and %R format specifiers. Colorize strings inside of %< %> quotes or quoted through q format modifier. c-family/ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format specifiers. cp/ * error.c (cp_print_error_function, print_instantiation_partial_context_line, maybe_print_constexpr_context): Colorize locus strings. From-SVN: r197841
2013-04-12 08:19:58 +02:00
DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ", "error")
DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ", "error")
DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ", "error")
DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ", "error")
DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ", "warning")
DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ", "warning")
DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ", "note")
DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ", "note")
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
/* These two would be re-classified as DK_WARNING or DK_ERROR, so the
prefix does not matter. */
opts.c: Include diagnostic-color.h. * opts.c: Include diagnostic-color.h. (common_handle_option): Handle OPT_fdiagnostics_color_. * Makefile.in (OBJS-libcommon): Add diagnostic-color.o. (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h. (diagnostic-color.o): New. * common.opt (fdiagnostics-color, fdiagnostics-color=): New options. (diagnostic_color_rule): New enum. * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*. * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around the location string. * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros, either NULL, or color kind. * diagnostic-color.c: New file. * diagnostic-color.h: New file. * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3 arguments. * doc/invoke.texi (-fdiagnostics-color): Document. * pretty-print.h (pp_show_color): Define. (struct pretty_print_info): Add show_color field. * diagnostic.c: Include diagnostic-color.h. (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND macros. Colorize error:, warning: etc. strings and also the location string. (diagnostic_show_locus): Colorize the caret line. * pretty-print.c: Include diagnostic-color.h. (pp_base_format): Handle %r and %R format specifiers. Colorize strings inside of %< %> quotes or quoted through q format modifier. c-family/ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format specifiers. cp/ * error.c (cp_print_error_function, print_instantiation_partial_context_line, maybe_print_constexpr_context): Colorize locus strings. From-SVN: r197841
2013-04-12 08:19:58 +02:00
DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ", NULL)
DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ", NULL)
/* This one is just for counting DK_WARNING promoted to DK_ERROR
due to -Werror and -Werror=warning. */
opts.c: Include diagnostic-color.h. * opts.c: Include diagnostic-color.h. (common_handle_option): Handle OPT_fdiagnostics_color_. * Makefile.in (OBJS-libcommon): Add diagnostic-color.o. (diagnostic.o, opts.o, pretty-print.o): Depend on diagnostic-color.h. (diagnostic-color.o): New. * common.opt (fdiagnostics-color, fdiagnostics-color=): New options. (diagnostic_color_rule): New enum. * dwarf2out.c (gen_producer_string): Don't print -fdiagnostics-color*. * langhooks.c (lhd_print_error_function): Add %r "locus" and %R around the location string. * diagnostic.def: Add 3rd argument to DEFINE_DIAGNOSTIC_KIND macros, either NULL, or color kind. * diagnostic-color.c: New file. * diagnostic-color.h: New file. * diagnostic-core.h (DEFINE_DIAGNOSTIC_KIND): Adjust macro for 3 arguments. * doc/invoke.texi (-fdiagnostics-color): Document. * pretty-print.h (pp_show_color): Define. (struct pretty_print_info): Add show_color field. * diagnostic.c: Include diagnostic-color.h. (diagnostic_build_prefix): Adjust for 3 argument DEFINE_DIAGNOSTIC_KIND macros. Colorize error:, warning: etc. strings and also the location string. (diagnostic_show_locus): Colorize the caret line. * pretty-print.c: Include diagnostic-color.h. (pp_base_format): Handle %r and %R format specifiers. Colorize strings inside of %< %> quotes or quoted through q format modifier. c-family/ * c-format.c (gcc_diag_char_table, gcc_tdiag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table): Add %r and %R format specifiers. cp/ * error.c (cp_print_error_function, print_instantiation_partial_context_line, maybe_print_constexpr_context): Colorize locus strings. From-SVN: r197841
2013-04-12 08:19:58 +02:00
DEFINE_DIAGNOSTIC_KIND (DK_WERROR, "error: ", NULL)
/* This is like DK_ICE, but backtrace is not printed. Used in the driver
when reporting fatal signal in the compiler. */
DEFINE_DIAGNOSTIC_KIND (DK_ICE_NOBT, "internal compiler error: ", "error")