From: johanknol Date: Sat, 3 Feb 2001 19:28:32 +0000 (+0000) Subject: as should return an error if one occurs X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=740177f86870050f06ddf1a9c57ccbfae3279c2f;p=fw%2Fsdcc as should return an error if one occurs git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@569 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/as/mcs51/asmain.c b/as/mcs51/asmain.c index 8c3d68dc..9dfe59bc 100644 --- a/as/mcs51/asmain.c +++ b/as/mcs51/asmain.c @@ -15,6 +15,7 @@ #include #include #if !defined(_MSC_VER) +#include #include #endif #include "asm.h" @@ -149,6 +150,9 @@ extern VOID machine(struct mne *); * REL, LST, and/or SYM files may be generated. */ +int fatalErrors=0; +char relFile[128]; + int main(argc, argv) char *argv[]; @@ -243,8 +247,11 @@ char *argv[]; if (inpfil == 0) { if (lflag) lfp = afile(p, "lst", 1); - if (oflag) - ofp = afile(p, "rel", 1); + if (oflag) { + ofp = afile(p, "rel", 1); + // save the file name if we have to delete it on error + strcpy(relFile,afn); + } if (sflag) tfp = afile(p, "sym", 1); } @@ -319,8 +326,10 @@ char *argv[]; if (lflag) { lstsym(lfp); } - asexit(aserr != 0); - return 0; + //printf ("aserr: %d\n", aserr); + //printf ("fatalErrors: %d\n", fatalErrors); + asexit(fatalErrors); + return 0; // hush the compiler } /*)Function VOID asexit(i) @@ -365,7 +374,11 @@ int i; /*for (j=0; j