2 * listerr.c - program to create the list of errors and warnings list from SDCCerr.c
4 * gcc -I ../../src listerr.c -o listerr
11 /* although this seems to be strange, this is the easiest way how to import the ErrTab without having to modify SDCCerr.c/h */
14 // this is to make SDCCerr happy - simulate global SDCC variables
20 /* predefined names for errorlevels */
21 char *ErrTypeName[] = {
23 /** All warnings, including those considered 'reasonable to use,
24 on occasion, in clean programs' (man 3 gcc). */
26 /** 'informational' warnings */
35 /* some simple internal variables */
40 int main(int argc, char *argv[])
42 printf("Number Type Text\n"); /* output file header */
43 printf("------------------------------------------------------------------------------\n");
44 for (i = 0; i < MAX_ERROR_WARNING; i++)
46 if (ErrTab[i].errIndex == i)
48 strcpy(s, ErrTab[i].errText);
49 for (p = s; NULL != (p = strchr(s, '\n')); )
50 *p = ' '; /* replace all newlines by spaces */
51 printf("%3d %-16.16s%s\n", ErrTab[i].errIndex, ErrTypeName[ErrTab[i].errType], s);