#include "common.h"
+#define USE_STDOUT_FOR_ERRORS 0
+
+#if USE_STDOUT_FOR_ERRORS
+#define ERRSINK stdout
+#else
+#define ERRSINK stderr
+#endif
+
#define ERROR 0
#define WARNING 1
extern FILE *lstFile;
{ ERROR ,"error *** 'extern' variable '%s' cannot be initialised \n" },
{ ERROR ,"error *** Pre-Processor %s\n" },
{ ERROR ,"error *** _dup call failed\n" },
-{ ERROR ,"error *** pointer being cast to incompatible type \n" },
+{ WARNING,"warning *** pointer being cast to incompatible type \n" },
{ WARNING,"warning *** 'while' loop with 'zero' constant.loop eliminated\n" },
{ WARNING,"warning *** %s expression has NO side effects.expr eliminated\n" },
{ WARNING,"warning *** constant value '%s', out of range.\n" },
{ WARNING,"warning *** possible code generation error at line %d,\n send source to sandeep.dutta@usa.net\n"},
{ WARNING,"warning *** pointer types incompatible \n" },
{ WARNING,"warning *** unknown memory model at %s : %d\n" },
+{ ERROR ,"error *** cannot generate code for target '%s'\n"},
+{ WARNING,"warning *** Indirect call to a banked function not implemented.\n"},
+{ WARNING,"warning *** Model '%s' not supported for %s, ignored.\n"},
+{ WARNING,"warning *** Both banked and nonbanked attributes used. nonbanked wins.\n"},
+{ WARNING,"warning *** Both banked and static used. static wins.\n"}
};
+void vwerror (int errNum, va_list marker)
+{
+ if ( ErrTab[errNum].errType== ERROR )
+ fatalError++ ;
+
+ if ( filename && lineno ) {
+ fprintf(ERRSINK, "%s(%d):",filename,lineno);
+ }
+ vfprintf(ERRSINK, ErrTab[errNum].errText,marker);
+}
+
/****************************************************************************/
/* werror - writes an error to the listing file & to standarderr */
/****************************************************************************/
void werror (int errNum, ... )
{
- va_list marker;
-
-
- if ( ErrTab[errNum].errType== ERROR )
- fatalError++ ;
-
- if ( filename && lineno ) {
- fprintf(stderr,"%s(%d):",filename,lineno);
- }
- va_start(marker,errNum);
- vfprintf(stderr,ErrTab[errNum].errText,marker);
- va_end( marker );
+ va_list marker;
+ va_start(marker,errNum);
+ vwerror(errNum, marker);
+ va_end( marker );
}