Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!linus!nixbur!nixpbe!ugun13!ridderbusch.pad From: ridderbusch.pad@nixdorf.com (Frank Ridderbusch, PXD-S4) Newsgroups: comp.sys.atari.st Subject: Re: saving GCC errors Message-ID: Date: 18 Dec 90 20:16:06 GMT References: <18949@netcom.UUCP> Sender: fgth@ugun13.UUCP Reply-To: ridderbusch.pad@nixdorf.com (Frank Ridderbusch, STO XS 141) Organization: Siemens Nixdorf Informationssysteme AG, Paderborn, West Germany Lines: 121 In-reply-to: rcb@netcom.UUCP's message of 16 Dec 90 23:08:48 GMT >>>>> On 16 Dec 90 23:08:48 GMT, rcb@netcom.UUCP (Roy Bixler) said: Roy> I am using GNU C inside of Gulam 1.04.05 to do some porting (of Roy> Z-modem version 3!) and this would be much less painful if there was Roy> a way to save the compilation errors in a file. I don't think GNU C Roy> has any listing option (if so, I'd sure like to know!). Another Roy> method I was thinking of was to re-direct the standard error output to Roy> a file, but apparently Gulam doesn't have that feature either. Any Roy> ideas? Roy> Roy Roy> netcom!rcb@apple.com Here are some diffs to gcc.c, which do just what you want. I introduced a new command line option (-z), which, when in effect, redirects stderr to a file. If you don't have the sources, drop me a note for the executable. *** i:\gcc.c Sat Mar 24 15:00:42 1990 --- gcc.c Sun Oct 7 17:44:48 1990 *************** *** 145,150 **** --- 145,151 ---- #ifdef atarist #include #include + #include long _stksize = 8192; extern char *getenv(); #endif *************** *** 354,359 **** --- 355,364 ---- unsigned char vflag; + #ifdef atarist + unsigned char zflag; + #endif + /* Name with which this program was invoked. */ char *programname; *************** *** 981,991 **** } #else /* atarist */ { ! char **j; ! execution_count++; ! j = commands[0].argv; ! return spawnve(0, j[0], j, NULL) ? -1 : 0; } #endif /* atarist */ } --- 986,1019 ---- } #else /* atarist */ { ! char **j; ! int errfd, ret; ! ! execution_count++; ! j = commands[0].argv; ! ! if (zflag) ! { ! errfd = Fopen("compile.err", 2); ! if (errfd < __SMALLEST_VALID_HANDLE) ! errfd = Fcreate("compile.err", 0); ! else ! Fseek(0L, errfd, 2); ! ! Fclose(2); ! Fforce(2, errfd); ! Fclose(errfd); ! } ! ! ret = spawnve(0, j[0], j, NULL) ? -1 : 0; ! ! if (zflag) ! { ! Fclose(2); ! Fforce(2, Fdup(1)); ! } ! return ret; } #endif /* atarist */ } *************** *** 1060,1065 **** --- 1088,1099 ---- vflag++; n_switches++; break; + #ifdef atarist + case 'z': + zflag++; + n_switches++; + break; + #endif default: n_switches++; ------------------------------------------------------------ -- MfG/Regards /==== Siemens Nixdorf Informationssysteme AG / Ridderbusch / , Heinz Nixdorf Ring / /./ 4790 Paderborn, West Germany /=== /,== ,===/ /,==, // / // / / // / / \ NERV:ridderbusch.pad / / `==/\ / / / \ BTX:0525467066-0001 Email: ridderbusch.pad@nixdorf.com (America (North & South)) ridderbusch.pad@sni.de (Rest of world)