changed some warnings to errors when codegen is skipped
[fw/sdcc] / support / Util / SDCCerr.c
index ad1e1abee9c06cc335ddd7a6cd091c90fd7e546a..e8b25529f1c21450822283324cc2e96d94c293c2 100644 (file)
@@ -52,9 +52,9 @@ struct
 { E_DUPLICATE, ERROR_LEVEL_ERROR,
    "Duplicate symbol '%s', symbol IGNORED" },
 { E_SYNTAX_ERROR, ERROR_LEVEL_ERROR,
-   "Syntax Error Declaration ignored" },
+   "Syntax error, declaration ignored at '%s'" },
 { E_CONST_EXPECTED, ERROR_LEVEL_ERROR,
-   "Constant Expected Found Variable" },
+    "Initializer element is not constant" },
 { E_OUT_OF_MEM, ERROR_LEVEL_ERROR,
    "'malloc' failed file '%s' for size %ld" },
 { E_FILE_OPEN_ERR, ERROR_LEVEL_ERROR,
@@ -87,7 +87,7 @@ struct
    "storage class not allowed for automatic variable '%s' in reentrant function unless static" },
 { E_AUTO_ABSA, ERROR_LEVEL_ERROR,
    "absolute address not allowed for automatic var '%s' in reentrant function " },
-{ W_INIT_WRONG, ERROR_LEVEL_WARNING,
+{ E_INIT_WRONG, ERROR_LEVEL_ERROR,
    "Initializer different levels of indirections" },
 { E_FUNC_REDEF, ERROR_LEVEL_ERROR,
    "Function name '%s' redefined " },
@@ -145,7 +145,7 @@ struct
    "operand invalid for bitwise operation" },
 { E_ANDOR_OP, ERROR_LEVEL_ERROR,
    "Invalid operand for '&&' or '||'" },
-{ E_TYPE_MISMATCH, ERROR_LEVEL_WARNING,
+{ E_TYPE_MISMATCH, ERROR_LEVEL_ERROR,
    "indirections to different types %s %s " },
 { E_AGGR_ASSIGN, ERROR_LEVEL_ERROR,
    "cannot assign values to aggregates" },
@@ -241,7 +241,7 @@ struct
 { W_DOUBLE_UNSUPPORTED, ERROR_LEVEL_WARNING,
    "type 'double' not supported assuming 'float'" },
 { W_IF_NEVER_TRUE, ERROR_LEVEL_WARNING,
-   "if-statement condition always false.if-statement not generated" },
+   "if-statement condition always falseif-statement not generated" },
 { W_FUNC_NO_RETURN, ERROR_LEVEL_WARNING,
    "no 'return' statement found for function '%s'" },
 { W_PRE_PROC_WARNING, ERROR_LEVEL_WARNING,
@@ -280,8 +280,8 @@ struct
    "function '%s' implicit declaration" },
 { W_CONTINUE, ERROR_LEVEL_WARNING,
    "%s" },
-{ I_TOOMANY_SPILS, ERROR_LEVEL_INFO,
-   "extended by %d bytes for compiler temp(s) :in function  '%s': %s " },
+{ I_EXTENDED_STACK_SPILS, ERROR_LEVEL_INFO,
+   "extended stack by %d bytes for compiler temp(s) :in function  '%s': %s " },
 { W_UNKNOWN_PRAGMA, ERROR_LEVEL_WARNING,
    "unknown or unsupported #pragma directive '%s'" },
 { W_SHIFT_CHANGED, ERROR_LEVEL_PEDANTIC,
@@ -311,7 +311,7 @@ struct
 { W_POSSBUG, ERROR_LEVEL_WARNING,
    "possible code generation error at line %d,\n"
    " send source to sandeep.dutta@usa.net" },
-{ E_INCOMPAT_PTYPES, ERROR_LEVEL_WARNING,
+{ E_INCOMPAT_PTYPES, ERROR_LEVEL_ERROR,
    "pointer types incompatible " },
 { W_UNKNOWN_MODEL, ERROR_LEVEL_WARNING,
    "unknown memory model at %s : %d" },
@@ -348,8 +348,8 @@ struct
     "both signed and unsigned specified for %s '%s'" },
 { E_TWO_OR_MORE_STORAGE_CLASSES, ERROR_LEVEL_ERROR,
     "two or more storage classes in declaration for '%s'" },
-{ W_EXESS_ARRAY_INITIALIZERS, ERROR_LEVEL_WARNING,
-    "excess elements in array initializer after `%s' at line %d" },
+{ W_EXCESS_INITIALIZERS, ERROR_LEVEL_WARNING,
+    "excess elements in %s initializer after `%s' at line %d" },
 { E_ARGUMENT_MISSING, ERROR_LEVEL_ERROR,
    "Option %s requires an argument." },
 { W_STRAY_BACKSLASH, ERROR_LEVEL_WARNING,
@@ -368,6 +368,12 @@ struct
     "converting pointer to integral without a cast" },
 { W_SYMBOL_NAME_TOO_LONG, ERROR_LEVEL_WARNING,
     "symbol name too long, truncated to %d chars" },
+{ W_CAST_STRUCT_PTR,ERROR_LEVEL_WARNING,
+         "cast of struct %s * to struct %s * " },
+{ W_IF_ALWAYS_TRUE, ERROR_LEVEL_WARNING,
+    "if-statement condition always true, if-statement not generated" },
+{ E_PARAM_NAME_OMITTED, ERROR_LEVEL_ERROR,
+    "in function %s: name omitted for parameter %d" },
 };
 
 /*
@@ -407,7 +413,7 @@ void vwerror (int errNum, va_list marker)
     if (ErrTab[errNum].errIndex != errNum)
     {
         fprintf(_SDCCERRG.out, 
-               "*** Internal error: error table entry for %d inconsistent.", errNum);
+               "Internal error: error table entry for %d inconsistent.", errNum);
     }
 
 
@@ -416,22 +422,24 @@ void vwerror (int errNum, va_list marker)
             fatalError++ ;
   
         if ( filename && lineno ) {
-            fprintf(_SDCCERRG.out, "%s(%d):",filename,lineno);
+            fprintf(_SDCCERRG.out, "%s:%d: ",filename,lineno);
         } else if (lineno) {
-            fprintf(_SDCCERRG.out, "at %d:", lineno);
+            fprintf(_SDCCERRG.out, "at %d: ", lineno);
+        } else {
+            fprintf(_SDCCERRG.out, "-:0: ");
         }
     
         switch(ErrTab[errNum].errType)
         {
             case ERROR_LEVEL_ERROR:
-               fprintf(_SDCCERRG.out, "error   *** ");
+               fprintf(_SDCCERRG.out, "error: ");
                break;
             case ERROR_LEVEL_WARNING:
             case ERROR_LEVEL_PEDANTIC:
-               fprintf(_SDCCERRG.out, "warning *** ");
+               fprintf(_SDCCERRG.out, "warning: ");
                break;
             case ERROR_LEVEL_INFO:
-               fprintf(_SDCCERRG.out, "info    *** ");
+               fprintf(_SDCCERRG.out, "info: ");
                break;
            default:
                break;