* clean.mk: fixed removal of files in bin/CVS/
[fw/sdcc] / support / Util / SDCCerr.c
index 9fefee3990f354642ef14c591fa4acb82170e42b..af987ae31b3eed4f67f67bdd3239f61e1331dd99 100644 (file)
@@ -32,7 +32,7 @@
 static struct {
     ERROR_LOG_LEVEL logLevel;
     FILE *out;
-       int style; // 1=MSVC
+    int style; /* 1=MSVC */
 } _SDCCERRG;
 
 extern char *filename ;
@@ -115,7 +115,7 @@ struct
 { E_INT_REQD, ERROR_LEVEL_ERROR,
    "type must be INT for bit field definition" },
 { E_BITFLD_SIZE, ERROR_LEVEL_ERROR,
-   "bit field size greater than 16. assuming 16" },
+   "bit field size cannot be greater than int (%d bits)" },
 { W_TRUNCATION, ERROR_LEVEL_WARNING,
    "high order truncation might occur" },
 { E_CODE_WRITE, ERROR_LEVEL_ERROR,
@@ -385,6 +385,18 @@ struct
     "duplicate %s member '%s'" },
 { E_STACK_VIOLATION, ERROR_LEVEL_ERROR,
     "'%s' internal stack %s" },
+{ W_INT_OVL, ERROR_LEVEL_PEDANTIC,
+    "integer overflow in expression" },
+{ W_USELESS_DECL, ERROR_LEVEL_WARNING,
+    "useless declaration (possible use of keyword as variable name)" },
+{ E_INT_BAD_INTNO, ERROR_LEVEL_ERROR,
+    "interrupt number '%u' is not valid" },
+{ W_BITFLD_NAMED, ERROR_LEVEL_WARNING,
+    "ignoring declarator of 0 length bitfield" },
+{ E_FUNC_ATTR, ERROR_LEVEL_ERROR,
+    "function attribute following non-function declaration"},
+{ W_SAVE_RESTORE, ERROR_LEVEL_PEDANTIC,
+    "unmatched #pragma SAVE and #pragma RESTORE" },
 };
 
 /*
@@ -463,7 +475,7 @@ void vwerror (int errNum, va_list marker)
         fprintf(_SDCCERRG.out, "\n");
     }
     else {
-        // Below the logging level, drop.
+        /* Below the logging level, drop. */
     }
 }
 /*
@@ -473,12 +485,12 @@ werror - Output a standard eror message with variable number of arguements
 -------------------------------------------------------------------------------
 */
 
-void werror (int errNum, ... )
+void werror (int errNum, ...)
 {
-    va_list    marker;
+    va_list marker;
     va_start(marker,errNum);
     vwerror(errNum, marker);
-    va_end( marker );
+    va_end(marker);
 }
 
 
@@ -488,12 +500,12 @@ fatal - Output a standard eror message with variable number of arguements and
         call exit()
 -------------------------------------------------------------------------------
 */
-void fatal (int exitCode, int errNum, ... )
+void fatal (int exitCode, int errNum, ...)
 {
-    va_list    marker;
+    va_list marker;
     va_start(marker,errNum);
     vwerror(errNum, marker);
-    va_end( marker );
+    va_end(marker);
 
     exit(exitCode);
 }
@@ -506,5 +518,5 @@ style - Change the output error style to MSVC
 
 void    MSVC_style (int style)
 {
-       _SDCCERRG.style=style;
+    _SDCCERRG.style = style;
 }