1 /*****************************************************************************/
5 /* Error handling for the ca65 macroassembler */
9 /* (C) 1998-2003 Ullrich von Bassewitz */
10 /* Römerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
46 /*****************************************************************************/
48 /*****************************************************************************/
54 WARN_NONE, /* No warning */
55 WARN_SYM_NOT_REFERENCED,
56 WARN_IMPORT_NOT_REFERENCED,
57 WARN_CANNOT_TRACK_STATUS,
58 WARN_SUSPICIOUS_ADDREXPR,
60 WARN_COUNT /* Warning count */
65 ERR_NONE, /* No error */
66 ERR_NOT_IMPLEMENTED, /* Command/operation not implemented */
67 ERR_CANNOT_OPEN_INCLUDE,
68 ERR_CANNOT_READ_INCLUDE,
71 ERR_HEX_DIGIT_EXPECTED,
88 ERR_CONSTEXPR_EXPECTED,
90 ERR_ENDMACRO_EXPECTED,
91 ERR_OPTION_KEY_EXPECTED,
96 ERR_NEWLINE_IN_STRING,
98 ERR_ILLEGAL_ADDR_MODE,
99 ERR_ILLEGAL_LOCALSTART,
100 ERR_ILLEGAL_LOCAL_USE,
102 ERR_ILLEGAL_SEG_ATTR,
106 ERR_ILLEGAL_ASSERT_ACTION,
108 ERR_SYM_ALREADY_DEFINED,
110 ERR_SYM_ALREADY_IMPORT,
111 ERR_SYM_ALREADY_EXPORT,
112 ERR_EXPORT_UNDEFINED,
113 ERR_EXPORT_MUST_BE_CONST,
121 ERR_MACRO_PARAM_EXPECTED,
122 ERR_CIRCULAR_REFERENCE,
123 ERR_SYM_REDECL_MISMATCH,
129 ERR_SEG_ATTR_MISMATCH,
130 ERR_SEGSTACK_OVERFLOW,
132 ERR_SEGSTACK_NOT_EMPTY,
133 ERR_CPU_NOT_SUPPORTED,
134 ERR_COUNTER_UNDERFLOW,
137 ERR_FILENAME_NOT_FOUND,
138 ERR_COUNT /* Error count */
146 FAT_TOO_MANY_SEGMENTS,
148 FAT_CANNOT_OPEN_INPUT,
149 FAT_CANNOT_STAT_INPUT,
150 FAT_CANNOT_OPEN_OUTPUT,
151 FAT_CANNOT_WRITE_OUTPUT,
152 FAT_CANNOT_OPEN_LISTING,
153 FAT_CANNOT_WRITE_LISTING,
154 FAT_CANNOT_READ_LISTING,
157 FAT_TOO_MANY_SYMBOLS,
158 FAT_COUNT /* Fatal error count */
164 extern unsigned WarnLevel;
167 extern unsigned ErrorCount;
168 extern unsigned WarningCount;
172 /*****************************************************************************/
174 /*****************************************************************************/
178 void Warning (unsigned WarnNum, ...);
179 /* Print warning message. */
181 void PWarning (const FilePos* Pos, unsigned WarnNum, ...);
182 /* Print warning message giving an explicit file and position. */
184 void Error (unsigned ErrNum, ...);
185 /* Print an error message */
187 void PError (const FilePos* Pos, unsigned ErrNum, ...);
188 /* Print an error message giving an explicit file and position. */
190 void ErrorSkip (unsigned ErrNum, ...);
191 /* Print an error message and skip the rest of the line */
193 void Fatal (unsigned FatNum, ...);
194 /* Print a message about a fatal error and die */
196 void Internal (const char* Format, ...);
197 /* Print a message about an internal compiler error and die. */