1 /*****************************************************************************/
5 /* Error handling for the cc65 C compiler */
9 /* (C) 1998-2000 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
12 /* EMail: uz@musoftware.de */
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 ERR_NONE, /* No error */
58 ERR_SEMICOLON_EXPECTED,
68 ERR_INCOMPATIBLE_TYPES,
69 ERR_INCOMPATIBLE_POINTERS,
70 ERR_TOO_MANY_FUNC_ARGS,
71 ERR_TOO_FEW_FUNC_ARGS,
72 ERR_DUPLICATE_MACRO_ARG,
73 ERR_VAR_IDENT_EXPECTED,
74 ERR_INT_EXPR_EXPECTED,
75 ERR_CONST_EXPR_EXPECTED,
77 ERR_MULTIPLE_DEFINITION,
78 ERR_CONFLICTING_TYPES,
81 ERR_MUST_RETURN_VALUE,
82 ERR_CANNOT_RETURN_VALUE,
83 ERR_UNEXPECTED_CONTINUE,
87 ERR_TOO_MANY_INITIALIZERS,
88 ERR_INIT_INCOMPLETE_TYPE,
92 ERR_STRUCT_FIELD_MISMATCH,
93 ERR_STRUCT_PTR_EXPECTED,
96 ERR_CPP_EXPR_EXPECTED,
98 ERR_ILLEGAL_FUNC_CALL,
101 ERR_ILLEGAL_HEX_DIGIT,
102 ERR_ILLEGAL_CHARCONST,
103 ERR_ILLEGAL_MODIFIER,
104 ERR_ILLEGAL_QUALIFIER,
105 ERR_ILLEGAL_STORAGE_CLASS,
106 ERR_ILLEGAL_ATTRIBUTE,
107 ERR_ILLEGAL_SEG_NAME,
113 ERR_MISSING_PARAM_NAME,
116 ERR_CANNOT_TAKE_ADDR_OF_REG,
121 ERR_DUPLICATE_QUALIFIER,
124 ERR_COUNT /* Error count */
127 /* Count of errors/warnings */
128 extern unsigned ErrorCount;
129 extern unsigned WarningCount;
133 /*****************************************************************************/
135 /*****************************************************************************/
139 void Warning (const char* Format, ...) attribute ((format (printf, 1, 2)));
140 /* Print warning message. */
142 void PPWarning (const char* Format, ...) attribute ((format (printf, 1, 2)));
143 /* Print warning message. For use within the preprocessor. */
145 void Error (unsigned ErrNum, ...);
146 /* Print an error message */
148 void MError (const char* Format, ...) attribute ((format (printf, 1, 2)));
149 /* Print an error message */
151 void PPError (const char* Format, ...) attribute ((format (printf, 1, 2)));
152 /* Print an error message. For use within the preprocessor. */
154 void Fatal (const char* Format, ...) attribute ((noreturn, format (printf, 1, 2)));
155 /* Print a message about a fatal error and die */
157 void Internal (char* Format, ...) attribute ((noreturn, format (printf, 1, 2)));
158 /* Print a message about an internal compiler error and die. */
160 void ErrorReport (void);
161 /* Report errors (called at end of compile) */