1 /* 2 * SDCCerr - Standard error handler 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #if !defined(__SDCCERR_H) 20 21 #define __SDCCERR_H 22 23 #include <stdio.h> 24 #include <stdarg.h> 25 26 /* ERROR Message Definition */ 27 28 enum { 29 E_DUPLICATE = 0, /* Duplicate variable */ 30 E_SYNTAX_ERROR = 1, /* Syntax Error */ 31 E_CONST_EXPECTED = 2, /* constant expected */ 32 E_OUT_OF_MEM = 3, /* malloc failed */ 33 E_FILE_OPEN_ERR = 4, /* File open failed */ 34 E_INVALID_OCLASS = 5, /* output class invalid */ 35 E_CANNOT_ALLOC = 6, /* cannot allocate space*/ 36 E_OLD_STYLE = 7, /* old style C ! allowed*/ 37 E_STACK_OUT = 8, /* v r out of stack */ 38 E_INTERNAL_ERROR = 9, /* unable to alloc tvar */ 39 E_LVALUE_REQUIRED = 10, /* lvalue required */ 40 E_TMPFILE_FAILED = 11, /* tmpfile creation failed */ 41 E_FUNCTION_EXPECTED = 12, /* function expected */ 42 E_USING_ERROR = 13, /* using in error */ 43 E_SFR_INIT = 14, /* init error for sbit */ 44 W_INIT_IGNORED = 15, /* initialiser ignored */ 45 E_AUTO_ASSUMED = 16, /* sclass auto assumed */ 46 E_AUTO_ABSA = 17, /* abs addr for auto var*/ 47 W_INIT_WRONG = 18, /* initializer type != */ 48 E_FUNC_REDEF = 19, /* func name redefined */ 49 E_ID_UNDEF = 20, /* identifer undefined */ 50 W_STACK_OVERFLOW = 21, /* stack overflow */ 51 E_NEED_ARRAY_PTR = 22, /* array or pointer reqd*/ 52 E_IDX_NOT_INT = 23, /* index not an integer */ 53 W_IDX_OUT_OF_BOUNDS = 24, /* array index out of bounds */ 54 E_STRUCT_UNION = 25, /* struct,union expected*/ 55 E_NOT_MEMBER = 26, /* !struct/union member */ 56 E_PTR_REQD = 27, /* pointer required */ 57 E_UNARY_OP = 28, /* unary operator bad op*/ 58 E_CONV_ERR = 29, /* conversion error */ 59 E_BITFLD_TYPE = 30, /* invalid type for bit-field */ 60 E_BITFLD_SIZE = 31, /* bit-field too wide for type */ 61 W_TRUNCATION = 32, /* high order trucation */ 62 E_CODE_WRITE = 33, /* trying 2 write to code */ 63 E_LVALUE_CONST = 34, /* lvalue is a const */ 64 E_ILLEGAL_ADDR = 35, /* address of bit */ 65 E_CAST_ILLEGAL = 36, /* cast illegal */ 66 E_MULT_INTEGRAL = 37, /* mult opernd must b integral */ 67 E_ARG_ERROR = 38, /* argument count error*/ 68 E_ARG_COUNT = 39, /* func expecting more */ 69 E_FUNC_EXPECTED = 40, /* func name expected */ 70 E_PLUS_INVALID = 41, /* plus invalid */ 71 E_PTR_PLUS_PTR = 42, /* pointer + pointer */ 72 E_SHIFT_OP_INVALID = 43, /* shft op op invalid */ 73 E_COMPARE_OP = 44, /* compare operand */ 74 E_BITWISE_OP = 45, /* bit op invalid op */ 75 E_ANDOR_OP = 46, /* && || op invalid */ 76 E_TYPE_MISMATCH = 47, /* type mismatch */ 77 E_ARRAY_ASSIGN = 48, /* array assign */ 78 E_ARRAY_DIRECT = 49, /* array indexing in */ 79 E_BIT_ARRAY = 50, /* bit array not allowed */ 80 E_DUPLICATE_TYPEDEF = 51, /* typedef name duplicate */ 81 E_ARG_TYPE = 52, /* arg type mismatch */ 82 E_RET_VALUE = 53, /* return value mismatch */ 83 E_FUNC_AGGR = 54, /* function returing aggr */ 84 E_FUNC_DEF = 55, /* ANSI Style def neede */ 85 E_DUPLICATE_LABEL = 56, /* duplicate label name */ 86 E_LABEL_UNDEF = 57, /* undefined label used */ 87 E_FUNC_VOID = 58, /* void func ret value */ 88 W_VOID_FUNC = 59, /* func must return value */ 89 W_RETURN_MISMATCH = 60, /* return value mismatch */ 90 E_CASE_CONTEXT = 61, /* case stmnt without switch */ 91 E_CASE_CONSTANT = 62, /* case expression ! const */ 92 E_BREAK_CONTEXT = 63, /* break statement invalid */ 93 E_SWITCH_AGGR = 64, /* non integral for switch */ 94 E_FUNC_BODY = 65, /* func has body already */ 95 E_UNKNOWN_SIZE = 66, /* variable has unknown size */ 96 E_AUTO_AGGR_INIT = 67, /* auto aggregates no init */ 97 E_INIT_COUNT = 68, /* too many initializers */ 98 E_INIT_STRUCT = 69, /* struct init wrong */ 99 E_INIT_NON_ADDR = 70, /* non address xpr for init */ 100 E_INT_DEFINED = 71, /* interrupt already over */ 101 E_INT_ARGS = 72, /* interrupt rtn cannot have args */ 102 E_INCLUDE_MISSING = 73, /* compiler include missing */ 103 E_NO_MAIN = 74, /* main function undefined */ 104 E_UNUSED_75 = 75, /* - removed error code - */ 105 E_PRE_PROC_FAILED = 76, /* preprocessor failed */ 106 E_DUP_FAILED = 77, /* file DUP failed */ 107 E_INCOMPAT_TYPES = 78, /* incompatible types casting */ 108 W_LOOP_ELIMINATE = 79, /* loop eliminated */ 109 W_NO_SIDE_EFFECTS = 80, /* expression has no side effects */ 110 W_CONST_TOO_LARGE = 81, /* constant out of range */ 111 W_BAD_COMPARE = 82, /* bad comparison */ 112 E_TERMINATING = 83, /* compiler terminating */ 113 W_LOCAL_NOINIT = 84, /* local reference before assignment */ 114 W_NO_REFERENCE = 85, /* no reference to local variable */ 115 E_OP_UNKNOWN_SIZE = 86, /* unknown size for operand */ 116 W_LONG_UNSUPPORTED = 87, /* 'long' not supported yet */ 117 W_LITERAL_GENERIC = 88, /* literal being cast to generic pointer */ 118 E_SFR_ADDR_RANGE = 89, /* sfr address out of range */ 119 E_BITVAR_STORAGE = 90, /* storage given for 'bit' variable */ 120 E_EXTERN_MISMATCH = 91, /* extern declaration mismatches */ 121 E_NONRENT_ARGS = 92, /* fptr non reentrant has args */ 122 W_DOUBLE_UNSUPPORTED = 93, /* 'double' not supported yet */ 123 W_COMP_RANGE = 94, /* comparison is always %s due to limited range of data type */ 124 W_FUNC_NO_RETURN = 95, /* no return statement found */ 125 W_PRE_PROC_WARNING = 96, /* preprocessor generated warning */ 126 E_STRUCT_AS_ARG = 97, /* structure passed as argument */ 127 E_PREV_DECL_CONFLICT = 98, /* previous declaration conflicts with current */ 128 E_CODE_NO_INIT = 99, /* vars in code space must have initializer */ 129 E_OPS_INTEGRAL = 100, /* operans must be integral for certain assignments */ 130 E_TOO_MANY_PARMS = 101, /* too many parameters */ 131 E_TOO_FEW_PARMS = 102, /* too few parameters */ 132 E_FUNC_NO_CODE = 103, /* fatalError */ 133 E_TYPE_MISMATCH_PARM = 104, /* type mismatch for parameter */ 134 E_INVALID_FLOAT_CONST = 105, /* invalid floating point literal string */ 135 E_INVALID_OP = 106, /* invalid operand for some operation */ 136 E_SWITCH_NON_INTEGER = 107, /* switch value not integer */ 137 E_CASE_NON_INTEGER = 108, /* case value not integer */ 138 W_FUNC_TOO_LARGE = 109, /* function too large */ 139 W_CONTROL_FLOW = 110, /* control flow changed due to optimization */ 140 W_PTR_TYPE_INVALID = 111, /* invalid type specifier for pointer */ 141 W_IMPLICIT_FUNC = 112, /* function declared implicitly */ 142 W_CONTINUE = 113, /* more than one line */ 143 I_EXTENDED_STACK_SPILS = 114, /* too many spils occured */ 144 W_UNKNOWN_PRAGMA = 115, /* #pragma directive unsupported */ 145 W_SHIFT_CHANGED = 116, /* shift changed to zero */ 146 W_UNKNOWN_OPTION = 117, /* don't know the option */ 147 W_UNSUPP_OPTION = 118, /* processor reset has been redifned */ 148 E_UNKNOWN_FEXT = 119, /* unknown file extension */ 149 W_TOO_MANY_SRC = 120, /* can only compile one .c file at a time */ 150 I_CYCLOMATIC = 121, /* information message */ 151 E_DIVIDE_BY_ZERO = 122, /* / 0 */ 152 E_FUNC_BIT = 123, /* function cannot return bit */ 153 E_CAST_ZERO = 124, /* casting to from size zero */ 154 W_CONST_RANGE = 125, /* constant too large */ 155 W_CODE_UNREACH = 126, /* unreachable code */ 156 W_NONPTR2_GENPTR = 127, /* non pointer cast to generic pointer */ 157 W_POSSBUG = 128, /* possible code generation error */ 158 E_INCOMPAT_PTYPES = 129, /* incompatible pointer assignment */ 159 W_UNKNOWN_MODEL = 130, /* Unknown memory model */ 160 E_UNKNOWN_TARGET = 131, /* target not defined */ 161 W_INDIR_BANKED = 132, /* Indirect call to a banked fun */ 162 W_UNSUPPORTED_MODEL = 133, /* Unsupported model, ignored */ 163 W_BANKED_WITH_NONBANKED = 134, /* banked and nonbanked attributes mixed */ 164 W_BANKED_WITH_STATIC = 135, /* banked and static mixed */ 165 W_INT_TO_GEN_PTR_CAST = 136, /* Converting integer type to generic pointer. */ 166 W_ESC_SEQ_OOR_FOR_CHAR = 137, /* Escape sequence of of range for char */ 167 E_INVALID_HEX = 138, /* \x used with no following hex digits */ 168 W_FUNCPTR_IN_USING_ISR = 139, /* Call via function pointer in ISR with using attribute. */ 169 E_NO_SUCH_BANK = 140, /* 'using' attribute specifies non-existant register bank. */ 170 E_TWO_OR_MORE_DATA_TYPES = 141, /* two or more data types in declaration for '%s' */ 171 E_LONG_OR_SHORT_INVALID = 142, /* long or short invalid for .. */ 172 E_SIGNED_OR_UNSIGNED_INVALID = 143, /* signed or unsigned invalid for .. */ 173 E_LONG_AND_SHORT_INVALID = 144, /* long and short invalid for .. */ 174 E_SIGNED_AND_UNSIGNED_INVALID = 145, /* signed and unsigned invalid for .. */ 175 E_TWO_OR_MORE_STORAGE_CLASSES = 146, /* two or more storage classes in declaration for '%s' */ 176 W_EXCESS_INITIALIZERS = 147, /* too much initializers for array */ 177 E_ARGUMENT_MISSING = 148, /* Option requires an argument. */ 178 W_STRAY_BACKSLASH = 149, /* stray '\\' at column %d" */ 179 W_NEWLINE_IN_STRING = 150, /* newline in string constant */ 180 W_USING_GENERIC_POINTER = 151, /* using generic pointer %s to initialize %s */ 181 W_EXCESS_SHORT_OPTIONS = 152, /* Only one short option can be specified at a time. Rest of %s ignored. */ 182 E_VOID_VALUE_USED = 153, /* void value not ignored as it ought to be */ 183 W_INTEGRAL2PTR_NOCAST = 154, /* converting integral to pointer without a cast */ 184 W_PTR2INTEGRAL_NOCAST = 155, /* converting pointer to integral without a cast */ 185 W_SYMBOL_NAME_TOO_LONG = 156, /* symbol name too long, truncated to %d chars */ 186 W_CAST_STRUCT_PTR = 157, /* pointer to different structure types */ 187 W_LIT_OVERFLOW = 158, /* overflow in implicit constant conversion */ 188 E_PARAM_NAME_OMITTED = 159, /* { in function %s: name omitted for parameter %d */ 189 W_NO_FILE_ARG_IN_C1 = 160, /* only standard input is compiled in c1 mode. file '%s' ignored */ 190 E_NEED_OPT_O_IN_C1 = 161, /* must specify assembler file name with -o in c1 mode */ 191 W_ILLEGAL_OPT_COMBINATION = 162, /* illegal combination of options (--c1mode, -E, -S -c) */ 192 E_DUPLICATE_MEMBER = 163, /* duplicate %s member '%s' */ 193 E_STACK_VIOLATION = 164, /* internal stack violation */ 194 W_INT_OVL = 165, /* integer overflow in expression */ 195 W_USELESS_DECL = 166, /* useless declaration */ 196 E_INT_BAD_INTNO = 167, /* invalid interrupt number */ 197 W_BITFLD_NAMED = 168, /* declarator used with 0 length bit-field */ 198 E_FUNC_ATTR = 169, /* function attribute without function */ 199 W_SAVE_RESTORE = 170, /* unmatched #pragma SAVE and #pragma RESTORE */ 200 E_INVALID_CRITICAL = 171, /* operation invalid in critical sequence */ 201 E_NOT_ALLOWED = 172, /* %s not allowed here */ 202 E_BAD_TAG = 173, /* '%s' is not a %s tag */ 203 E_ENUM_NON_INTEGER = 174, /* enumeration constant not an integer */ 204 W_DEPRECATED_PRAGMA = 175, /* deprecated pragma */ 205 E_SIZEOF_INCOMPLETE_TYPE = 176, /* sizeof applied to an incomplete type */ 206 E_PREVIOUS_DEF = 177, /* previously defined here */ 207 W_SIZEOF_VOID = 178, /* size of void is zero */ 208 W_POSSBUG2 = 179, /* possible bug, new format */ 209 W_COMPLEMENT = 180, /* ~bit can give unexpected results */ 210 E_SHADOWREGS_NO_ISR = 181, /* shadowregs keyword following non-ISR function */ 211 W_SFR_ABSRANGE = 182, /* sfr at address out of range */ 212 E_BANKED_WITH_CALLEESAVES = 183, /* banked and callee-saves mixed */ 213 W_INVALID_INT_CONST = 184, /* invalid integer literal string */ 214 W_CMP_SU_CHAR = 185, /* comparison of 'signed char' with 'unsigned char' requires promotion to int */ 215 W_INVALID_FLEXARRAY = 186, /* invalid use of structure with flexible array member */ 216 W_C89_NO_FLEXARRAY = 187, /* ISO C90 does not support flexible array members */ 217 E_FLEXARRAY_NOTATEND = 188, /* flexible array member not at end of struct */ 218 E_FLEXARRAY_INEMPTYSTRCT = 189, /* flexible array in otherwise empty struct */ 219 W_EMPTY_SOURCE_FILE = 190, /* ISO C forbids an empty source file */ 220 W_BAD_PRAGMA_ARGUMENTS = 191, /* #pragma %s: bad argument(s); pragma ignored */ 221 E_BAD_RESTRICT = 192, /* Only object pointers may be qualified with 'restrict' */ 222 E_BAD_INLINE = 193, /* Only functions may be qualified with 'inline' */ 223 E_BAD_INT_ARGUMENT = 194, /* Bad integer option argument */ 224 E_NEGATIVE_ARRAY_SIZE = 195, /* Size of array '%s' is negative */ 225 W_TARGET_LOST_QUALIFIER = 196, /* Pointer target lost qualifier */ 226 W_DEPRECATED_KEYWORD = 197, /* keyword '%s' is deprecated, use '%s' instead */ 227 E_STORAGE_CLASS_FOR_PARAMETER = 198, /* storage class specified for parameter '%s' */ 228 E_OFFSETOF_TYPE = 199, /* offsetof can only be applied to structs/unions */ 229 E_INCOMPLETE_FIELD = 200, /* struct field has incomplete type */ 230 W_DEPRECATED_OPTION = 201, /* deprecated compiler option '%s' */ 231 E_BAD_DESIGNATOR = 202, /* Bad designated initializer */ 232 W_DUPLICATE_INIT = 203, /* duplicate initializer */ 233 E_INVALID_UNIVERSAL = 204, /* invalid universal character name %s. */ 234 W_UNIVERSAL_C95 = 205, /* universal character names are only valid in C95 or later */ 235 E_SHORTLONG = 206, /* Invalid combination of short / long */ 236 E_INTEGERSUFFIX = 207, /* Invalid integer suffix */ 237 E_AUTO_ADDRSPACE = 208, /* named address space for auto var */ 238 W_NORETURNRETURN = 209, /* return in _noreturn function */ 239 E_STRUCT_REDEF = 210, /* struct or union tag redefined */ 240 W_STRING_CANNOT_BE_TERMINATED = 211, /* string cannot be terminated within array */ 241 W_LONGLONG_LITERAL = 212, /* long long literal */ 242 S_SYNTAX_ERROR = 213, /* syntax error */ 243 E_MIXING_CONFIG = 214, /* mixing __CONFIG and CONFIG directives */ 244 W_STATIC_ASSERTION = 215, /* static assertion failed */ 245 E_ALIGNAS = 216, /* invalid alignment specified */ 246 W_INTERNAL_ERROR = 217, /* warning for non-fatal internal errors - things that should not have happened, but can be handled */ 247 W_UNRECOGNIZED_ASM = 218, /* unrecognized asm instruction in peephole optimizer */ 248 W_FLEXARRAY_INSTRUCT = 219, /* using flexible arrays in a struct */ 249 E_TYPE_IS_FUNCTION = 220, /* typedef void foo_t(void); foo_t foo; */ 250 W_INLINE_NAKED = 221, /* inline function is naked */ 251 E_Z88DK_FASTCALL_PARAMETERS = 222, /* invalid number of parameters in __z88dk_fastcall */ 252 E_Z88DK_FASTCALL_PARAMETER = 223, /* invalid parameter type in __z88dk_fastcall */ 253 W_REPEAT_QUALIFIER = 224, /* the same qualifier appears more than once */ 254 W_NO_TYPE_SPECIFIER = 225, /* type specifier missing in declaration */ 255 E_NO_TYPE_SPECIFIER = 226, /* type specifier missing in declaration */ 256 E_MULTIPLE_DEFAULT_IN_GENERIC = 227, /* multiple default expressions in generic association */ 257 E_MULTIPLE_MATCHES_IN_GENERIC = 228, /* multiple matching expressions in generic association */ 258 E_NO_MATCH_IN_GENERIC = 229, /* no matching expression in generic association */ 259 W_LABEL_WITHOUT_STATEMENT = 230, /* label without statement, not allowed in standard C */ 260 E_WCHAR_CONST_C95 = 231, /* character constant of type wchar_t requires ISO C 95 or later */ 261 E_WCHAR_CONST_C11 = 232, /* character constant of type char16_t or char32_t equires ISO C 11 or later */ 262 E_WCHAR_STRING_C95 = 233, /* wide character string literal requires ISO C 95 or later */ 263 E_WCHAR_STRING_C11 = 234, /* wide character string literal requires ISO C 11 or later */ 264 W_UNKNOWN_REG = 235, /* unknown register specified */ 265 E_HEXFLOAT_C99 = 236, /* hexadecimal floating constant requires ISO C99 or later */ 266 E_ANONYMOUS_STRUCT_TAG = 237, /* anonymous struct/union should not have a tag */ 267 W_INLINE_FUNCATTR = 238, /* inline functions should not be z88dk_fastcall or z88dk_callee */ 268 E_FOR_INITAL_DECLARATION_C99 = 239, /* initial declaration in for loop requires ISO C99 or later */ 269 E_QUALIFIED_ARRAY_PARAM_C99 = 240, /* qualifiers in array parameters require ISO C99 or later */ 270 E_QUALIFIED_ARRAY_NOPARAM = 241, /* qualifier or static in array declarator that is not a parameter */ 271 E_STATIC_ARRAY_PARAM_C99 = 242, /* static in array parameters requires ISO C99 or later */ 272 E_INT_MULTIPLE = 243, /* multiple interrupt numbers */ 273 W_INCOMPAT_PTYPES = 244, /* incompatible pointer assignment (not allowed by the standard, but allowed in SDCC) */ 274 E_STATIC_ASSERTION_C2X = 245, /* static assertion with one argument requires C2X or later */ 275 W_STATIC_ASSERTION_2 = 246, /* static assertion failed */ 276 E_DECL_AFTER_STATEMENT_C99 = 247, /* declaration after statement requires ISO C99 or later */ 277 E_SHORTCALL_INVALID_VALUE = 248, /* Invalid value for a __z88dk_shortcall specifier */ 278 E_DUPLICATE_PARAMTER_NAME = 249, /* duplicate parameter name */ 279 E_AUTO_FILE_SCOPE = 250, /* auto in declaration at file scope */ 280 E_U8_CHAR_C2X = 251, /* u8 character constant requires ISO C2X or later */ 281 E_U8_CHAR_INVALID = 252, /* invalid u8 character constant */ 282 E_ATTRIBUTE_C2X = 253, /* attribute requires ISO C2X or later */ 283 E_COMPOUND_LITERALS_C99 = 254, /* compound literals require ISO C99 or later */ 284 285 /* don't touch this! */ 286 NUMBER_OF_ERROR_MESSAGES /* Number of error messages */ 287 }; 288 289 /** sdcc style assertion */ 290 #ifdef assert 291 #undef assert 292 #endif 293 #ifdef NDEBUG 294 # define assert(expr) (void)0 295 #else 296 # define assert(expr) ((expr) ? (void)0 : fatal (1, E_INTERNAL_ERROR, __FILE__, __LINE__, #expr)) 297 #endif 298 299 #define wassertl_bt(a,s) (void)((a) ? 0 : \ 300 (werror_bt (E_INTERNAL_ERROR, __FILE__, __LINE__, s), 0)) 301 302 #define wassert_bt(a) wassertl_bt(a, "code generator internal error") 303 304 /** Describes the maximum error level that will be logged. Any level 305 * includes all of the levels listed after it. 306 * 307 * 308 */ 309 enum _ERROR_LOG_LEVEL { 310 /** Everything. Currently the same as PEDANTIC. */ 311 ERROR_LEVEL_ALL, 312 /** All warnings, including those considered 'reasonable to use, 313 on occasion, in clean programs' (man 3 gcc). */ 314 ERROR_LEVEL_PEDANTIC, 315 /** 'informational' warnings */ 316 ERROR_LEVEL_INFO, 317 /** Most warnings. */ 318 ERROR_LEVEL_WARNING, 319 /** Errors only. */ 320 ERROR_LEVEL_ERROR, 321 /** Syntax error only. */ 322 ERROR_LEVEL_SYNTAX_ERROR 323 }; 324 325 typedef enum _ERROR_LOG_LEVEL ERROR_LOG_LEVEL; 326 327 struct SDCCERRG { 328 ERROR_LOG_LEVEL logLevel; 329 FILE *out; 330 int style; /* 1=MSVC */ 331 int werror; /* treat the warnings as errors */ 332 }; 333 334 extern struct SDCCERRG _SDCCERRG; 335 336 /** Sets the maximum error level to log. 337 See MAX_ERROR_LEVEL. The default is ERROR_LEVEL_ALL. 338 */ 339 void setErrorLogLevel (ERROR_LOG_LEVEL level); 340 341 /* 342 ------------------------------------------------------------------------------- 343 SetErrorOut - Set the error output file 344 345 ------------------------------------------------------------------------------- 346 */ 347 348 FILE * SetErrorOut (FILE *NewErrorOut); 349 350 /* 351 ------------------------------------------------------------------------------- 352 vwerror - Output a standard eror message with variable number of arguements 353 354 ------------------------------------------------------------------------------- 355 */ 356 357 int vwerror (int errNum, va_list marker); 358 359 /* 360 ------------------------------------------------------------------------------- 361 werror - Output a standard eror message with variable number of arguements 362 363 ------------------------------------------------------------------------------- 364 */ 365 366 int werror (int errNum, ... ); 367 368 /* 369 ------------------------------------------------------------------------------- 370 werror_bt - like werror(), but als provide a backtrace 371 372 ------------------------------------------------------------------------------- 373 */ 374 375 int werror_bt (int errNum, ... ); 376 377 /* 378 ------------------------------------------------------------------------------- 379 werrorfl - Output a standard eror message with variable number of arguements. 380 Use a specified filename and line number instead of the default. 381 382 ------------------------------------------------------------------------------- 383 */ 384 385 int werrorfl (char *newFilename, int newLineno, int errNum, ...); 386 387 /* 388 ------------------------------------------------------------------------------- 389 fatal - Output a standard eror message with variable number of arguements and 390 call exit() 391 ------------------------------------------------------------------------------- 392 */ 393 394 void fatal (int exitCode, int errNum, ... ); 395 396 /* 397 ------------------------------------------------------------------------------- 398 style - Change the output error style to MSVC 399 ------------------------------------------------------------------------------- 400 */ 401 402 void MSVC_style (int style); 403 404 /* 405 ------------------------------------------------------------------------------- 406 disabled - Disable output of specified warning 407 ------------------------------------------------------------------------------- 408 */ 409 410 void setWarningDisabled (int errNum); 411 412 /* 413 ------------------------------------------------------------------------------- 414 disabledState - Enable/Disable output of specified warning 415 ------------------------------------------------------------------------------- 416 */ 417 418 int setWarningDisabledState (int errNum, int disabled); 419 420 /* 421 ------------------------------------------------------------------------------- 422 Set the flag to treat warnings as errors 423 ------------------------------------------------------------------------------- 424 */ 425 void setWError (int flag); 426 427 #endif 428