X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2FUtil%2FSDCCerr.c;h=6698c0a44e41052284766ab23d613816820292d6;hb=78d7ee2c82ef0a5d1207823537f4efe6d04a3d50;hp=b4308cd16a5ff4aea2d99eafc9a1fa6f3e64d0b3;hpb=c5aa67f49a030f8a432689a8c94b9b02e8cf37e4;p=fw%2Fsdcc diff --git a/support/Util/SDCCerr.c b/support/Util/SDCCerr.c index b4308cd1..6698c0a4 100644 --- a/support/Util/SDCCerr.c +++ b/support/Util/SDCCerr.c @@ -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, @@ -71,13 +71,13 @@ struct "FATAL Compiler Internal Error in file '%s' line number '%d' : %s \n" "Contact Author with source code" }, { E_LVALUE_REQUIRED, ERROR_LEVEL_ERROR, - "'lvalue' required for '%s' operation ." }, + "'lvalue' required for '%s' operation." }, { E_TMPFILE_FAILED, ERROR_LEVEL_ERROR, "Creation of temp file failed" }, { E_FUNCTION_EXPECTED, ERROR_LEVEL_ERROR, "called object is not a function" }, { E_USING_ERROR, ERROR_LEVEL_ERROR, - "'using', 'interrupt' or 'reentrant' must follow a function definiton .'%s'" }, + "'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'" }, @@ -114,11 +114,11 @@ 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 greater than 16. assuming 16" }, { 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" }, + "Attempt to assign value to a constant variable (%s)" }, { E_LVALUE_CONST, ERROR_LEVEL_ERROR, "Lvalue specifies constant object" }, { E_ILLEGAL_ADDR, ERROR_LEVEL_ERROR, @@ -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" }, @@ -207,8 +207,8 @@ struct "Pre-Processor %s" }, { E_DUP_FAILED, ERROR_LEVEL_ERROR, "_dup call failed" }, -{ W_INCOMPAT_CAST, ERROR_LEVEL_WARNING, - "pointer being cast to incompatible type " }, +{ 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, @@ -226,9 +226,10 @@ struct { E_OP_UNKNOWN_SIZE, ERROR_LEVEL_ERROR, "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" }, + "'%s' 'long' not supported , declared as 'int'." }, +{ 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, @@ -240,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 false, if-statement not generated" }, { W_FUNC_NO_RETURN, ERROR_LEVEL_WARNING, "no 'return' statement found for function '%s'" }, { W_PRE_PROC_WARNING, ERROR_LEVEL_WARNING, @@ -279,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, @@ -292,7 +293,7 @@ struct { W_UNKNOWN_FEXT, ERROR_LEVEL_WARNING, "don't know what to do with file '%s'. file extension unsupported" }, { W_TOO_MANY_SRC, ERROR_LEVEL_WARNING, - "cannot compile more than one source file . file '%s' ignored" }, + "cannot compile more than one source file. file '%s' ignored" }, { I_CYCLOMATIC, ERROR_LEVEL_INFO, "function '%s', # edges %d , # nodes %d , cyclomatic complexity %d" }, { E_DIVIDE_BY_ZERO, ERROR_LEVEL_ERROR, @@ -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_ERROR, "pointer types incompatible " }, { W_UNKNOWN_MODEL, ERROR_LEVEL_WARNING, "unknown memory model at %s : %d" }, @@ -347,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, @@ -361,6 +362,24 @@ struct "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" }, +{ 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" }, +{ W_NO_FILE_ARG_IN_C1, ERROR_LEVEL_WARNING, + "only standard input is compiled in c1 mode. file '%s' ignored" }, +{ E_NEED_OPT_O_IN_C1, ERROR_LEVEL_ERROR, + "must specify assembler file name with -o in c1 mode" }, +{ W_ILLEGAL_OPT_COMBINATION, ERROR_LEVEL_WARNING, + "illegal combination of options (--c1mode, -E, -S -c)" }, }; /* @@ -400,7 +419,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); } @@ -409,22 +428,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;