X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fca65%2Ferror.c;h=75045763841c5febca0adfc4a27a6eebdcbdb26c;hb=46209118b1a77d2e57f28026b1e5916c2c074778;hp=89616206aad29e3c43c3833d72be3aa43ba5ffe3;hpb=1c715a5ee33a5dc90ff32ea3bc729ac84df8cffc;p=cc65 diff --git a/src/ca65/error.c b/src/ca65/error.c index 89616206a..750457638 100644 --- a/src/ca65/error.c +++ b/src/ca65/error.c @@ -1,8 +1,8 @@ /*****************************************************************************/ /* */ -/* error.c */ +/* error.c */ /* */ -/* Error handling for the ca65 macroassembler */ +/* Error handling for the ca65 macroassembler */ /* */ /* */ /* */ @@ -37,6 +37,8 @@ #include #include +/* ca65 */ +#include "filetab.h" #include "nexttok.h" #include "error.h" @@ -51,15 +53,6 @@ /* Warning level */ unsigned WarnLevel = 1; -/* Messages for internal compiler errors */ -const char _MsgCheckFailed [] = - "Check failed: `%s' (= %d), file `%s', line %u\n"; -const char _MsgPrecondition [] = - "Precondition violated: `%s' (= %d), file `%s', line %u\n"; -const char _MsgFail [] = - "%s, file `%s', line %u\n"; - - /* Statistics */ unsigned ErrorCount = 0; unsigned WarningCount = 0; @@ -83,6 +76,7 @@ void WarningMsg (const FilePos* Pos, unsigned WarnNum, va_list ap) { 2, "Symbol `%s' is defined but never used" }, { 2, "Symbol `%s' is imported but never used" }, { 1, "Cannot track processor status byte" }, + { 0, "User warning: %s" }, }; if (Warnings [WarnNum-1].Level <= WarnLevel) { @@ -128,9 +122,10 @@ void ErrorMsg (const FilePos* Pos, unsigned ErrNum, va_list ap) /* Print an error message */ { static const char* Msgs [ERR_COUNT-1] = { - "Command/operation not implemented", - "Cannot open include file `%s': %s", - "Include nesting too deep", + "Command/operation not implemented", + "Cannot open include file `%s': %s", + "Cannot read from include file `%s': %s", + "Include nesting too deep", "Invalid input character: %02X", "Hex digit expected", "Digit expected", @@ -153,6 +148,7 @@ void ErrorMsg (const FilePos* Pos, unsigned ErrNum, va_list ap) "Identifier expected", "`.endmacro' expected", "Option key expected", + "`=' expected", "Command is only valid in 65816 mode", "User error: %s", "String constant too long", @@ -163,13 +159,13 @@ void ErrorMsg (const FilePos* Pos, unsigned ErrNum, va_list ap) "Illegal use of local symbol", "Illegal segment name: `%s'", "Illegal segment attribute", - "Illegal macro package name", + "Illegal macro package name", "Illegal emulation feature", "Syntax error", "Symbol `%s' is already defined", "Undefined symbol `%s'", - "Symbol `%s' is marked as import", - "Symbol `%s' is marked as export", + "Symbol `%s' is already marked as import", + "Symbol `%s' is already marked as export", "Exported symbol `%s' is undefined", "Exported values must be constant", ".IF nesting too deep", @@ -184,14 +180,15 @@ void ErrorMsg (const FilePos* Pos, unsigned ErrNum, va_list ap) "Circular reference in symbol definition", "Symbol redeclaration mismatch", "Alignment value must be a power of 2", - "Duplicate `.ELSE'", + "Duplicate `.ELSE'", "Conditional assembly branch was never closed", "Lexical level was not terminated correctly", "Segment attribute mismatch", - "CPU not supported", + "CPU not supported", "Counter underflow", "Undefined label", "Open `%s´", + "File name `%s' not found in file table", }; fprintf (stderr, "%s(%lu): Error #%u: ",