* support/scripts/listerr.c: program to create the list of errors and
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 22 Apr 2007 07:09:02 +0000 (07:09 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 22 Apr 2007 07:09:02 +0000 (07:09 +0000)
  warnings list from - added
* doc/sdccman.lyx: removed the note
  "For list of warnings and corresponding codes, see err_warn.txt"

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4761 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
doc/sdccman.lyx
support/scripts/listerr.c [new file with mode: 0644]

index c102ac520acd402bfecbc88b801785edb5c7fa85..5c7d017a15280c4a1274d74f2a64218aed238991 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-22 Borut Razem <borut.razem AT siol.net>
+
+       * support/scripts/listerr.c: program to create the list of errors and
+         warnings list from - added
+       * doc/sdccman.lyx: removed the note
+         "For list of warnings and corresponding codes, see err_warn.txt"
+
 2007-04-20 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * as/mcs51/asmain.c (search_path_append, search_path_fopen): new, added,
index bad5622e176b2b32171417204c44a4ab17cce6f5..683daf16a5b3afdb9842879f81b138ddf352fce9 100644 (file)
@@ -21109,24 +21109,6 @@ disable_warning
 \end_inset
 
  - the compiler will not warn you anymore about warning number <nnnn>.
-\begin_inset Note Note
-status open
-
-\begin_layout Itemize
-\begin_inset Quotes sld
-\end_inset
-
-For list of warnings and corresponding codes, see err_warn.txt
-\begin_inset Quotes srd
-\end_inset
-
- This list should probably be part of the manual? See Patch #1697136 
-\end_layout
-
-\end_inset
-
-.
 \end_layout
 
 \begin_layout Itemize
diff --git a/support/scripts/listerr.c b/support/scripts/listerr.c
new file mode 100644 (file)
index 0000000..d5d7439
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * listerr.c - program to create the list of errors and warnings list from SDCCerr.c
+ *
+ * gcc -I ../Util listerr.c -o listerr
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* although this seems to be strange, this is the easiest way how to import the ErrTab without having to modify SDCCerr.c/h */
+#include "SDCCerr.c"
+
+// this is to make SDCCerr happy - simulate global SDCC variables
+char *filename ;
+int lineno ;
+int fatalError ;
+
+
+/* predefined names for errorlevels */
+char *ErrTypeName[] = {
+  "ALL   ",
+  /** All warnings, including those considered 'reasonable to use,
+    on occasion, in clean programs' (man 3 gcc). */
+  "PEDANTIC",
+  /** 'informational' warnings */
+  "INFO  ",
+  /** Most warnings. */
+  "WARNING ",
+  /** Errors only. */
+  "ERROR   "
+  };
+
+
+/* some simple internal variables */
+int i;
+char s[256];
+char *p;
+
+int main(int argc, char *argv[])
+{
+  printf("Number  Type            Text\n"); /* output file header */
+  printf("------------------------------------------------------------------------------\n");
+  for (i = 0; i < MAX_ERROR_WARNING; i++)
+    {
+      if (ErrTab[i].errIndex == i)
+        {
+          strcpy(s, ErrTab[i].errText);
+          for (p = s; NULL != (p = strchr(s, '\n')); )
+            *p = ' '; /* replace all newlines by spaces */
+          printf("%3d     %-16.16s%s\n", ErrTab[i].errIndex, ErrTypeName[ErrTab[i].errType], s);
+        }
+    }
+
+  return 0;
+}
+