+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,
\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
--- /dev/null
+/*
+ * 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;
+}
+