From 70330cebae14eb86028737e7a4c156e83b60fe43 Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 22 Apr 2007 07:09:02 +0000 Subject: [PATCH] * 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" git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4761 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 7 +++++ doc/sdccman.lyx | 18 ------------- support/scripts/listerr.c | 57 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 support/scripts/listerr.c diff --git a/ChangeLog b/ChangeLog index c102ac52..5c7d017a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-04-22 Borut Razem + + * 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 * as/mcs51/asmain.c (search_path_append, search_path_fopen): new, added, diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index bad5622e..683daf16 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -21109,24 +21109,6 @@ disable_warning \end_inset - the compiler will not warn you anymore about warning number . - -\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 index 00000000..d5d74396 --- /dev/null +++ b/support/scripts/listerr.c @@ -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 +#include +#include + +/* 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; +} + -- 2.30.2