From: johanknol Date: Tue, 6 Feb 2001 17:22:27 +0000 (+0000) Subject: Tell us at least the linenumber X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=209c0663b7f891431cfc91bd5987a67055c45144;p=fw%2Fsdcc Tell us at least the linenumber git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@592 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCerr.c b/src/SDCCerr.c index be2946cf..be6f2552 100644 --- a/src/SDCCerr.c +++ b/src/SDCCerr.c @@ -164,6 +164,8 @@ void vwerror (int errNum, va_list marker) if ( filename && lineno ) { fprintf(ERRSINK, "%s(%d):",filename,lineno); + } else { + fprintf(ERRSINK, "at %d:",lineno); } vfprintf(ERRSINK, ErrTab[errNum].errText,marker); } diff --git a/support/Util/SDCCerr.c b/support/Util/SDCCerr.c index 25f772e6..7cd6602a 100644 --- a/support/Util/SDCCerr.c +++ b/support/Util/SDCCerr.c @@ -202,18 +202,20 @@ vwerror - Output a standard eror message with variable number of arguements */ void vwerror (int errNum, va_list marker) - { -if (!ErrorOut) - ErrorOut = DEFAULT_ERROR_OUT ; - -if ( ErrTab[errNum].errType == ERROR ) + if (!ErrorOut) + ErrorOut = DEFAULT_ERROR_OUT ; + + if ( ErrTab[errNum].errType == ERROR ) fatalError++ ; - -if ( filename && lineno ) + + if ( filename && lineno ) { fprintf(ErrorOut, "%s(%d):",filename,lineno); - -vfprintf(ErrorOut, ErrTab[errNum].errText,marker); + } else { + fprintf(ErrorOut, "at %d:", lineno); + } + + vfprintf(ErrorOut, ErrTab[errNum].errText,marker); } /* ------------------------------------------------------------------------------- diff --git a/support/Util/SDCCerr.h b/support/Util/SDCCerr.h index bc18d4cd..9c4e0d87 100644 --- a/support/Util/SDCCerr.h +++ b/support/Util/SDCCerr.h @@ -117,7 +117,7 @@ SDCCERR - SDCC Standard error handler #define E_CODE_NO_INIT 99 /* vars in code space must have initializer */ #define E_OPS_INTEGRAL 100 /* operans must be integral for certian assignments */ #define E_TOO_MANY_PARMS 101 /* too many parameters */ -#define E_TO_FEW_PARMS 102 /* to few parameters */ +#define E_TOO_FEW_PARMS 102 /* to few parameters */ #define E_FUNC_NO_CODE 103 /* fatalError */ #define E_TYPE_MISMATCH_PARM 104 /* type mismatch for parameter */ #define E_INVALID_FLOAT_CONST 105 /* invalid floating point literal string */