diagnostic.def: New file.
authorGabriel Dos Reis <gdr@codesourcery.com>
Tue, 1 May 2001 08:19:45 +0000 (08:19 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Tue, 1 May 2001 08:19:45 +0000 (08:19 +0000)
      * diagnostic.def: New file.
      * diagnostic.h (diagnostic_t): New enum.
      * Makefile.in (diagnostic.o): Depend on diagnostic.def

From-SVN: r41717

gcc/ChangeLog
gcc/Makefile.in
gcc/diagnostic.def [new file with mode: 0644]
gcc/diagnostic.h

index 938667d5555f6edc24b28298d023ffb6739cea61..711faeb535764f2fdc536685f4aa402e4c45a2b5 100644 (file)
@@ -1,3 +1,9 @@
+2001-05-01  Gabriel Dos Reis  <gdr@codesourcery.com>
+
+       * diagnostic.def: New file.
+       * diagnostic.h (diagnostic_t): New enum.
+       * Makefile.in (diagnostic.o): Depend on diagnostic.def
+
 2001-04-30  Zack Weinberg  <zackw@stanford.edu>
 
        * tsystem.h: Test only POSIX for availability of string.h 
index 5365f7c4b255a1e43f234bb6e7442b0f49af6e36..4788db4392aac746fa33b3cd4ccba3715e55fe96 100644 (file)
@@ -1371,7 +1371,7 @@ stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h \
    function.h $(EXPR_H) $(RTL_H) toplev.h $(GGC_H) $(TM_P_H)
 fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) flags.h toplev.h \
    $(EXPR_H) $(RTL_H) $(GGC_H) $(TM_P_H)
-diagnostic.o : diagnostic.c diagnostic.h \
+diagnostic.o : diagnostic.c diagnostic.h diagnostic.def \
    $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(TM_P_H) flags.h \
    $(GGC_H) input.h $(INSN_ATTR_H) insn-config.h toplev.h intl.h 
 toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
diff --git a/gcc/diagnostic.def b/gcc/diagnostic.def
new file mode 100644 (file)
index 0000000..07aa495
--- /dev/null
@@ -0,0 +1,7 @@
+DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "Fatal error: ")
+DEFINE_DIAGNOSTIC_KIND (DK_ICE, "Internal compiler error: ")
+DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "Sorry, unimplemented: ")
+DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "Error: ")
+DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "Warning: ")
+DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "Anachronism: ")
+DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "Note: ")
index eb7594e16fcc80654d530d6f2ee37144941d3b3c..68092adee3f36d8ab7bc9cedff179968cef79a05 100644 (file)
@@ -31,6 +31,16 @@ typedef void (*diagnostic_starter_fn) PARAMS ((output_buffer *,
                                                diagnostic_context *));
 typedef diagnostic_starter_fn diagnostic_finalizer_fn;
 
+typedef enum
+{
+#define DEFINE_DIAGNOSTIC_KIND(K, M) K,  
+#include "diagnostic.def"
+#undef DEFINE_DIAGNOSTIC_KIND
+  DK_LAST_DIAGNOSTIC_KIND
+} diagnostic_t;
+
+#define pedantic_error_kind() (flag_pedantic_errors ? DK_ERROR : DK_WARNING)
+
 #define DIAGNOSTICS_SHOW_PREFIX_ONCE       0x0
 #define DIAGNOSTICS_SHOW_PREFIX_NEVER      0x1
 #define DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE 0x2