]> git.sur5r.net Git - cc65/blob - src/cc65/error.h
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / src / cc65 / error.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                  error.h                                  */
4 /*                                                                           */
5 /*                  Error handling for the cc65 C compiler                   */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 1998     Ullrich von Bassewitz                                        */
10 /*              Wacholderweg 14                                              */
11 /*              D-70597 Stuttgart                                            */
12 /* EMail:       uz@musoftware.de                                             */
13 /*                                                                           */
14 /*                                                                           */
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.                                    */
18 /*                                                                           */
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:                            */
22 /*                                                                           */
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              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef ERROR_H
37 #define ERROR_H
38
39
40
41 /*****************************************************************************/
42 /*                                   Data                                    */
43 /*****************************************************************************/
44
45
46
47 /* Warning numbers */
48 enum Warnings {
49     WARN_NONE,                          /* No warning */
50     WARN_UNREACHABLE_CODE,
51     WARN_COND_NEVER_TRUE,
52     WARN_COND_ALWAYS_TRUE,
53     WARN_PTR_TO_INT_CONV,
54     WARN_INT_TO_PTR_CONV,
55     WARN_FUNC_WITHOUT_PROTO,
56     WARN_UNKNOWN_PRAGMA,
57     WARN_NO_CASE_LABELS,
58     WARN_FUNC_MUST_BE_EXTERN,
59     WARN_UNUSED_PARM,
60     WARN_UNUSED_ITEM,
61     WARN_CONSTANT_IS_LONG,
62     WARN_NESTED_COMMENT,
63     WARN_COUNT                          /* Warning count */
64 };
65
66 /* Error numbers */
67 enum Errors {
68     ERR_NONE,                           /* No error */
69     ERR_INVALID_CHAR,
70     ERR_UNEXPECTED_NEWLINE,
71     ERR_EOF_IN_COMMENT,
72     ERR_SYNTAX,
73     ERR_QUOTE_EXPECTED,
74     ERR_COLON_EXPECTED,
75     ERR_SEMICOLON_EXPECTED,
76     ERR_LPAREN_EXPECTED,
77     ERR_RPAREN_EXPECTED,
78     ERR_LBRACK_EXPECTED,
79     ERR_RBRACK_EXPECTED,
80     ERR_LCURLY_EXPECTED,
81     ERR_RCURLY_EXPECTED,
82     ERR_IDENT_EXPECTED,
83     ERR_TYPE_EXPECTED,
84     ERR_INCOMPATIBLE_TYPES,
85     ERR_INCOMPATIBLE_POINTERS,
86     ERR_TOO_MANY_FUNC_ARGS,
87     ERR_TOO_FEW_FUNC_ARGS,
88     ERR_MACRO_ARGCOUNT,
89     ERR_DUPLICATE_MACRO_ARG,
90     ERR_VAR_IDENT_EXPECTED,
91     ERR_INT_EXPR_EXPECTED,
92     ERR_CONST_EXPR_EXPECTED,
93     ERR_NO_ACTIVE_LOOP,
94     ERR_INCLUDE_LTERM_EXPECTED,
95     ERR_INCLUDE_RTERM_EXPECTED,
96     ERR_INCLUDE_NOT_FOUND,
97     ERR_INCLUDE_OPEN_FAILURE,
98     ERR_INVALID_USER_ERROR,
99     ERR_USER_ERROR,
100     ERR_UNEXPECTED_CPP_ENDIF,
101     ERR_UNEXPECTED_CPP_ELSE,
102     ERR_CPP_ENDIF_EXPECTED,
103     ERR_CPP_DIRECTIVE_EXPECTED,
104     ERR_MULTIPLE_DEFINITION,
105     ERR_STRLIT_EXPECTED,
106     ERR_WHILE_EXPECTED,
107     ERR_MUST_RETURN_VALUE,
108     ERR_CANNOT_RETURN_VALUE,
109     ERR_UNEXPECTED_CONTINUE,
110     ERR_UNDEFINED_SYMBOL,
111     ERR_UNDEFINED_LABEL,
112     ERR_INCLUDE_NESTING,
113     ERR_TOO_MANY_LOCALS,
114     ERR_TOO_MANY_INITIALIZERS,
115     ERR_INIT_INCOMPLETE_TYPE,
116     ERR_CANNOT_SUBSCRIPT,
117     ERR_OP_NOT_ALLOWED,
118     ERR_STRUCT_EXPECTED,
119     ERR_STRUCT_FIELD_MISMATCH,
120     ERR_STRUCT_PTR_EXPECTED,
121     ERR_LVALUE_EXPECTED,
122     ERR_EXPR_EXPECTED,
123     ERR_CPP_EXPR_EXPECTED,
124     ERR_ILLEGAL_TYPE,
125     ERR_ILLEGAL_FUNC_CALL,
126     ERR_ILLEGAL_INDIRECT,
127     ERR_ILLEGAL_ADDRESS,
128     ERR_ILLEGAL_MACRO_CALL,
129     ERR_ILLEGAL_HEX_DIGIT,
130     ERR_ILLEGAL_CHARCONST,
131     ERR_ILLEGAL_MODIFIER,
132     ERR_ILLEGAL_STORAGE_CLASS,
133     ERR_DIV_BY_ZERO,
134     ERR_MOD_BY_ZERO,
135     ERR_RANGE,
136     ERR_SYMBOL_KIND,
137     ERR_LEVEL_NESTING,
138     ERR_MISSING_PARAM_NAME,
139     ERR_OLD_STYLE_PROTO,
140     ERR_PARAM_DECL,
141     ERR_CANNOT_TAKE_ADDR_OF_REG,
142     ERR_ILLEGAL_SIZE,
143     ERR_FASTCALL,
144     ERR_UNKNOWN_SIZE,
145     ERR_COUNT                           /* Error count */
146 };
147
148 /* Fatal errors */
149 enum Fatals {
150     FAT_NONE,
151     FAT_TOO_MANY_ERRORS,
152     FAT_CANNOT_OPEN_OUTPUT,
153     FAT_CANNOT_WRITE_OUTPUT,
154     FAT_CANNOT_OPEN_INPUT,
155     FAT_OUT_OF_MEMORY,
156     FAT_STACK_OVERFLOW,
157     FAT_STACK_EMPTY,
158     FAT_OUT_OF_STRSPACE,
159     FAT_TOO_MANY_CASE_LABELS,
160     FAT_COUNT                           /* Fatal error count */
161 };
162
163
164
165 /* Count of errors/warnings */
166 extern unsigned ErrorCount;
167 extern unsigned WarningCount;
168
169
170
171 /*****************************************************************************/
172 /*                                   code                                    */
173 /*****************************************************************************/
174
175
176
177 void Warning (unsigned WarnNum, ...);
178 /* Print warning message. */
179
180 void PPWarning (unsigned WarnNum, ...);
181 /* Print warning message. For use within the preprocessor. */
182
183 void Error (unsigned ErrNum, ...);
184 /* Print an error message */
185
186 void PPError (unsigned ErrNum, ...);
187 /* Print an error message. For use within the preprocessor.  */
188
189 void Fatal (unsigned FatNum, ...);
190 /* Print a message about a fatal error and die */
191
192 void Internal (char* Format, ...);
193 /* Print a message about an internal compiler error and die. */
194
195 void ErrorReport (void);
196 /* Report errors (called at end of compile) */
197
198
199
200 /* End of error.h */
201 #endif
202
203
204
205
206