extra warnings for excess scalar/array/struct initializers
[fw/sdcc] / support / Util / SDCCerr.h
index 42090f57974e7598428297af8a06be102115866a..ae338face3e610b8fb22ee3da1298b229ad81996 100644 (file)
@@ -30,10 +30,10 @@ SDCCERR - SDCC Standard error handler
 #define  E_FUNCTION_EXPECTED  12     /* function expected    */
 #define  E_USING_ERROR     13        /* using in error       */
 #define  E_SFR_INIT        14        /* init error for sbit  */
-#define  E_INIT_IGNORED    15        /* initialiser ignored  */
+#define  W_INIT_IGNORED    15        /* initialiser ignored  */
 #define  E_AUTO_ASSUMED    16        /* sclass auto assumed  */
 #define  E_AUTO_ABSA       17        /* abs addr for auto var*/
-#define  E_INIT_WRONG      18        /* initializer type !=  */
+#define  W_INIT_WRONG      18        /* initializer type !=  */
 #define  E_FUNC_REDEF      19        /* func name redefined  */
 #define  E_ID_UNDEF        20        /* identifer undefined  */
 #define  W_STACK_OVERFLOW  21        /* stack overflow       */
@@ -47,7 +47,7 @@ SDCCERR - SDCC Standard error handler
 #define  E_CONV_ERR        29        /* conversion error     */
 #define  E_INT_REQD        30        /* bit field must be int*/
 #define  E_BITFLD_SIZE     31        /* bit field size > 16  */
-#define  E_TRUNCATION      32        /* high order trucation */
+#define  W_TRUNCATION      32        /* high order trucation */
 #define  E_CODE_WRITE      33        /* trying 2 write to code */
 #define  E_LVALUE_CONST    34        /* lvalue is a const   */   
 #define  E_ILLEGAL_ADDR    35        /* address of bit      */
@@ -75,7 +75,7 @@ SDCCERR - SDCC Standard error handler
 #define  E_LABEL_UNDEF     57        /* undefined label used   */
 #define  E_FUNC_VOID       58        /* void func ret value    */
 #define  E_VOID_FUNC       59        /* func must return value */
-#define  E_RETURN_MISMATCH 60        /* return value mismatch  */
+#define  W_RETURN_MISMATCH 60        /* return value mismatch  */
 #define  E_CASE_CONTEXT    61        /* case stmnt without switch */
 #define  E_CASE_CONSTANT   62        /* case expression ! const*/
 #define  E_BREAK_CONTEXT   63        /* break statement invalid*/
@@ -93,21 +93,21 @@ SDCCERR - SDCC Standard error handler
 #define         E_EXTERN_INIT     75        /* extern variable initialised     */
 #define  E_PRE_PROC_FAILED 76       /* preprocessor failed             */
 #define  E_DUP_FAILED     77        /* file DUP failed             */
-#define  E_INCOMPAT_CAST   78       /* incompatible pointer casting */
-#define  E_LOOP_ELIMINATE  79       /* loop eliminated                       */          
+#define  E_INCOMPAT_TYPES  78       /* incompatible types casting */
+#define  W_LOOP_ELIMINATE  79       /* loop eliminated                       */          
 #define  W_NO_SIDE_EFFECTS  80      /* expression has no side effects */
-#define  E_CONST_TOO_LARGE  81      /* constant out of range             */
+#define  W_CONST_TOO_LARGE  81      /* constant out of range             */
 #define         W_BAD_COMPARE      82       /* bad comparison                            */
 #define  E_TERMINATING      83       /* compiler terminating                     */
 #define  W_LOCAL_NOINIT            84       /* local reference before assignment */
 #define  W_NO_REFERENCE            85          /* no reference to local variable       */
 #define         E_OP_UNKNOWN_SIZE  86          /* unknown size for operand                     */
 #define  W_LONG_UNSUPPORTED 87         /* 'long' not supported yet                     */
-#define  W_LITERAL_GENERIC  88         /* literal being cast to generic pointer */
+#define  E_LITERAL_GENERIC  88         /* literal being cast to generic pointer */
 #define  E_SFR_ADDR_RANGE   89         /* sfr address out of range                     */
 #define         E_BITVAR_STORAGE   90          /* storage given for 'bit' variable     */
-#define  W_EXTERN_MISMATCH  91         /* extern declaration mismatches    */
-#define  E_NONRENT_ARGS            92          /* fptr non reentrant has args          */
+#define  E_EXTERN_MISMATCH  91         /* extern declaration mismatches    */
+#define  W_NONRENT_ARGS            92          /* fptr non reentrant has args          */
 #define  W_DOUBLE_UNSUPPORTED 93       /* 'double' not supported yet                   */
 #define  W_IF_NEVER_TRUE    94         /* if always false                                      */
 #define  W_FUNC_NO_RETURN   95         /* no return statement found            */
@@ -124,12 +124,12 @@ SDCCERR - SDCC Standard error handler
 #define  E_INVALID_OP      106          /* invalid operand for some operation */
 #define  E_SWITCH_NON_INTEGER 107       /* switch value not integer */
 #define  E_CASE_NON_INTEGER 108         /* case value not integer */
-#define  E_FUNC_TOO_LARGE   109         /* function too large     */
+#define  W_FUNC_TOO_LARGE   109         /* function too large     */
 #define  W_CONTROL_FLOW     110         /* control flow changed due to optimization */
 #define  W_PTR_TYPE_INVALID 111         /* invalid type specifier for pointer       */
 #define  W_IMPLICIT_FUNC    112         /* function declared implicitly             */
-#define  E_CONTINUE         113         /* more than one line                       */
-#define  W_TOOMANY_SPILS    114         /* too many spils occured                   */
+#define  W_CONTINUE         113         /* more than one line                       */
+#define  I_TOOMANY_SPILS    114         /* too many spils occured                   */
 #define  W_UNKNOWN_PRAGMA   115         /* #pragma directive unsupported            */
 #define  W_SHIFT_CHANGED    116         /* shift changed to zero                    */
 #define  W_UNKNOWN_OPTION   117         /* don't know the option                    */
@@ -142,9 +142,9 @@ SDCCERR - SDCC Standard error handler
 #define  E_CAST_ZERO        124         /* casting to from size zero  */
 #define  W_CONST_RANGE      125         /* constant too large         */
 #define  W_CODE_UNREACH     126         /* unreachable code           */
-#define  W_NONPTR2_GENPTR   127         /* non pointer cast to generic pointer */
+#define  E_NONPTR2_GENPTR   127         /* non pointer cast to generic pointer */
 #define  W_POSSBUG          128         /* possible code generation error */
-#define  W_PTR_ASSIGN       129         /* incampatible pointer assignment */
+#define  E_INCOMPAT_PTYPES  129         /* incampatible pointer assignment */
 #define  W_UNKNOWN_MODEL    130                /* Unknown memory model */
 #define  E_UNKNOWN_TARGET   131         /* target not defined   */
 #define         W_INDIR_BANKED     132         /* Indirect call to a banked fun */
@@ -154,9 +154,30 @@ SDCCERR - SDCC Standard error handler
 #define  W_INT_TO_GEN_PTR_CAST 136     /* Converting integer type to generic pointer. */
 #define  W_ESC_SEQ_OOR_FOR_CHAR 137     /* Escape sequence of of range for char */
 #define  E_INVALID_HEX 138              /* \x used with no following hex digits */
+#define  W_FUNCPTR_IN_USING_ISR        139     /* Call via function pointer in ISR with using attribute. */
+#define  E_NO_SUCH_BANK                140     /* 'using' attribute specifies non-existant register bank. */
+#define E_TWO_OR_MORE_DATA_TYPES 141
+#define E_LONG_OR_SHORT_INVALID  142    /* long or short invalid for .. */
+#define E_SIGNED_OR_UNSIGNED_INVALID 143    /* signed or unsigned invalid for .. */
+#define E_LONG_AND_SHORT_INVALID  144    /* long and short invalid for .. */
+#define E_SIGNED_AND_UNSIGNED_INVALID 145 /* signed and unsigned invalid for .. */
+#define E_TWO_OR_MORE_STORAGE_CLASSES 146
+#define W_EXCESS_INITIALIZERS 147 /* too much initializers for array */
+#define        E_ARGUMENT_MISSING      148     /* Option requires an argument. */
+#define W_STRAY_BACKSLASH 149
+#define W_NEWLINE_IN_STRING 150 
+#define E_CANNOT_USE_GENERIC_POINTER 151
+#define W_EXCESS_SHORT_OPTIONS 152
+#define E_VOID_VALUE_USED 153
+#define W_INTEGRAL2PTR_NOCAST 154
+#define W_PTR2INTEGRAL_NOCAST 155
+#define W_SYMBOL_NAME_TOO_LONG 156
+#define W_CAST_STRUCT_PTR 157 /* pointer to different structure types */
 
 /** Describes the maximum error level that will be logged.  Any level
-    includes all of the levels listed after it.
+ *  includes all of the levels listed after it.
+ *
+ *
  */
 enum _ERROR_LOG_LEVEL {
     /** Everything.  Currently the same as PEDANTIC. */
@@ -164,10 +185,12 @@ enum _ERROR_LOG_LEVEL {
     /** All warnings, including those considered 'reasonable to use,
         on occasion, in clean programs' (man 3 gcc). */
     ERROR_LEVEL_PEDANTIC,
+    /** 'informational' warnings */
+    ERROR_LEVEL_INFO,
     /** Most warnings. */
-    ERROR_LEVEL_WARNINGS,
+    ERROR_LEVEL_WARNING,
     /** Errors only. */
-    ERROR_LEVEL_ERRORS
+    ERROR_LEVEL_ERROR
 };
 
 typedef enum _ERROR_LOG_LEVEL ERROR_LOG_LEVEL;