Created
[fw/sdcc] / support / Util / SDCCerr.c
index 5c27d41e032ffc66957a042f7247892cf27311fc..15e2618b3fb43c41e41afe290990a2dac921c689 100644 (file)
@@ -75,19 +75,19 @@ struct
 { E_TMPFILE_FAILED, ERROR_LEVEL_ERROR,
    "Creation of temp file failed" },
 { E_FUNCTION_EXPECTED, ERROR_LEVEL_ERROR,
-   "Function expected here '%s'" },
+   "called object is not a function" },
 { E_USING_ERROR, ERROR_LEVEL_ERROR,
    "'using', 'interrupt' or 'reentrant' must follow a function definiton .'%s'" },
 { E_SFR_INIT, ERROR_LEVEL_ERROR,
    "Absolute address & initial value both cannot be specified for\n"
    " a 'sfr','sbit' storage class, initial value ignored '%s'" },
-{ E_INIT_IGNORED, ERROR_LEVEL_WARNING,
+{ W_INIT_IGNORED, ERROR_LEVEL_WARNING,
    "Variable in the storage class cannot be initialized.'%s'" },
-{ E_AUTO_ASSUMED, ERROR_LEVEL_WARNING,
-   "storage class not allowed for automatic variable '%s' in reentrant function" },
+{ E_AUTO_ASSUMED, ERROR_LEVEL_ERROR,
+   "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 " },
-{ E_INIT_WRONG, ERROR_LEVEL_WARNING,
+{ W_INIT_WRONG, ERROR_LEVEL_WARNING,
    "Initializer different levels of indirections" },
 { E_FUNC_REDEF, ERROR_LEVEL_ERROR,
    "Function name '%s' redefined " },
@@ -115,7 +115,7 @@ struct
    "type must be INT for bit field definition" },
 { E_BITFLD_SIZE, ERROR_LEVEL_ERROR,
    "bit field size greater than 16 . assuming 16" },
-{ E_TRUNCATION, ERROR_LEVEL_WARNING,
+{ W_TRUNCATION, ERROR_LEVEL_WARNING,
    "high order truncation might occur" },
 { E_CODE_WRITE, ERROR_LEVEL_ERROR,
    "Attempt to assign value to a constant variable %s" },
@@ -171,7 +171,7 @@ struct
    "void function returning value" },
 { E_VOID_FUNC, ERROR_LEVEL_ERROR,
    "function '%s' must return value" },
-{ E_RETURN_MISMATCH, ERROR_LEVEL_WARNING,
+{ W_RETURN_MISMATCH, ERROR_LEVEL_WARNING,
    "function return value mismatch" },
 { E_CASE_CONTEXT, ERROR_LEVEL_ERROR,
    "'case/default' found without 'switch'.statement ignored" },
@@ -207,13 +207,13 @@ struct
    "Pre-Processor %s" },
 { E_DUP_FAILED, ERROR_LEVEL_ERROR,
    "_dup call failed" },
-{ E_INCOMPAT_CAST, ERROR_LEVEL_WARNING,
-   "pointer being cast to incompatible type " },
-{ E_LOOP_ELIMINATE, ERROR_LEVEL_WARNING,
+{ E_INCOMPAT_TYPES, ERROR_LEVEL_ERROR,
+   "incompatible types" },
+{ W_LOOP_ELIMINATE, ERROR_LEVEL_WARNING,
    "'while' loop with 'zero' constant.loop eliminated" },
 { W_NO_SIDE_EFFECTS, ERROR_LEVEL_WARNING,
    "%s expression has NO side effects.expr eliminated" },
-{ E_CONST_TOO_LARGE, ERROR_LEVEL_PEDANTIC,
+{ W_CONST_TOO_LARGE, ERROR_LEVEL_PEDANTIC,
    "constant value '%s', out of range." },
 { W_BAD_COMPARE, ERROR_LEVEL_WARNING,
    "comparison will either, ALWAYs succeed or ALWAYs fail" },
@@ -227,15 +227,16 @@ struct
    "unknown size for operand" },
 { W_LONG_UNSUPPORTED, ERROR_LEVEL_WARNING,
    "'%s' 'long' not supported , declared as 'int' ." },
-{ W_LITERAL_GENERIC, ERROR_LEVEL_WARNING,
-   "LITERAL value being cast to '_generic' pointer" },
+{ E_LITERAL_GENERIC, ERROR_LEVEL_ERROR,
+    //"illegal cast of LITERAL value to 'generic' pointer: assuming 'xdata' pointer" },
+    "illegal cast of LITERAL value to 'generic' pointer" },
 { E_SFR_ADDR_RANGE, ERROR_LEVEL_ERROR,
    "%s '%s' address out of range" },
 { E_BITVAR_STORAGE, ERROR_LEVEL_ERROR,
    "storage class CANNOT be specified for bit variable '%s'" },
-{ W_EXTERN_MISMATCH, ERROR_LEVEL_WARNING,
+{ E_EXTERN_MISMATCH, ERROR_LEVEL_ERROR,
    "extern definition for '%s' mismatches with declaration." },
-{ E_NONRENT_ARGS, ERROR_LEVEL_WARNING,
+{ W_NONRENT_ARGS, ERROR_LEVEL_WARNING,
    "Functions called via pointers must be 'reentrant' to take arguments" },
 { W_DOUBLE_UNSUPPORTED, ERROR_LEVEL_WARNING,
    "type 'double' not supported assuming 'float'" },
@@ -259,7 +260,7 @@ struct
    "too few parameters" },
 { E_FUNC_NO_CODE, ERROR_LEVEL_ERROR,
    "code not generated for '%s' due to previous errors" },
-{ E_TYPE_MISMATCH_PARM, ERROR_LEVEL_WARNING,
+{ E_TYPE_MISMATCH_PARM, ERROR_LEVEL_ERROR,
    "type mismatch for parameter number %d" },
 { E_INVALID_FLOAT_CONST, ERROR_LEVEL_ERROR,
    "invalid float constant '%s'" },
@@ -269,7 +270,7 @@ struct
    "switch value not an integer" },
 { E_CASE_NON_INTEGER, ERROR_LEVEL_ERROR,
    "case label not an integer" },
-{ E_FUNC_TOO_LARGE, ERROR_LEVEL_WARNING,
+{ W_FUNC_TOO_LARGE, ERROR_LEVEL_WARNING,
    "function '%s' too large for global optimization" },
 { W_CONTROL_FLOW, ERROR_LEVEL_PEDANTIC,
    "conditional flow changed by optimizer '%s(%d)':so said EVELYN the modified DOG" },
@@ -277,9 +278,9 @@ struct
    "invalid type specifier for pointer type specifier ignored" },
 { W_IMPLICIT_FUNC, ERROR_LEVEL_WARNING,
    "function '%s' implicit declaration" },
-{ E_CONTINUE, ERROR_LEVEL_WARNING,
+{ W_CONTINUE, ERROR_LEVEL_WARNING,
    "%s" },
-{ W_TOOMANY_SPILS, ERROR_LEVEL_INFO,
+{ I_TOOMANY_SPILS, ERROR_LEVEL_INFO,
    "extended by %d bytes for compiler temp(s) :in function  '%s': %s " },
 { W_UNKNOWN_PRAGMA, ERROR_LEVEL_WARNING,
    "unknown or unsupported #pragma directive '%s'" },
@@ -305,12 +306,12 @@ struct
    "constant is out of range %s" },
 { W_CODE_UNREACH, ERROR_LEVEL_PEDANTIC,
    "unreachable code %s(%d)" },
-{ W_NONPTR2_GENPTR, ERROR_LEVEL_WARNING,
-   "non-pointer type cast to _generic pointer" },
+{ E_NONPTR2_GENPTR, ERROR_LEVEL_ERROR,
+   "non-pointer type cast to generic pointer" },
 { W_POSSBUG, ERROR_LEVEL_WARNING,
    "possible code generation error at line %d,\n"
    " send source to sandeep.dutta@usa.net" },
-{ W_PTR_ASSIGN, ERROR_LEVEL_WARNING,
+{ E_INCOMPAT_PTYPES, ERROR_LEVEL_WARNING,
    "pointer types incompatible " },
 { W_UNKNOWN_MODEL, ERROR_LEVEL_WARNING,
    "unknown memory model at %s : %d" },
@@ -352,9 +353,19 @@ struct
 { E_ARGUMENT_MISSING, ERROR_LEVEL_ERROR,
    "Option %s requires an argument." },
 { W_STRAY_BACKSLASH, ERROR_LEVEL_WARNING,
-    "stray '\\' in program" },
+    "stray '\\' at column %d" },
 { W_NEWLINE_IN_STRING, ERROR_LEVEL_WARNING,
     "newline in string constant" },
+{ E_CANNOT_USE_GENERIC_POINTER, ERROR_LEVEL_ERROR,
+    "cannot use generic pointer %s to initialize %s" },
+{ W_EXCESS_SHORT_OPTIONS, ERROR_LEVEL_WARNING,
+    "Only one short option can be specified at a time.  Rest of %s ignored." },
+{ E_VOID_VALUE_USED, ERROR_LEVEL_ERROR,
+    "void value not ignored as it ought to be" },
+{ W_INTEGRAL2PTR_NOCAST, ERROR_LEVEL_WARNING,
+    "converting integral to pointer without a cast" },
+{ W_PTR2INTEGRAL_NOCAST, ERROR_LEVEL_WARNING,
+    "converting pointer to integral without a cast" },
 };
 
 /*