Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.misc Subject: Re: UNIX C-compiler Message-ID: <1990Apr12.192458.16096@athena.mit.edu> Date: 12 Apr 90 19:24:58 GMT References: <1558@wacsvax.OZ> <5154@rtech.rtech.com> <2JO2148xds13@ficc.uu.net> <3659@hcx1.SSD.CSD.HARRIS.COM> Sender: news@athena.mit.edu (News system) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 45 In article <3659@hcx1.SSD.CSD.HARRIS.COM>, brad@SSD.CSD.HARRIS.COM (Brad Appleton) writes: > I bet it wouldnt be obscenely hard to make a shell/awk/sed/perl script to take > the output of cc and insert the error messages into the file, after the > line in which they occur (anyone care to try this one out?). Then your map > command could: > > 1) write the file > 2) compile the program and send/pipe the error output to the script > 3) do a re-sync command from vi so that you are now editing the file > with the inserted messages. > > If you want to get fancy, you can put some funky text around the error > messages "%%% ###" and add step 4) to search for "^%%%.*###$". > You can delete the messages with "g/^%%%.*###$/d" You're right, it wouldn't be obscenely hard to do this with a script. However, Berkeley has already written a C program to do it, and the source code for that program is freely redistributable, so why reinvent the wheel? To quote from error(1): Error analyzes and optionally disperses the diagnostic error messages produced by a number of compilers and language pro- cessors to the source file and line where the errors occurred. It can replace the painful, traditional methods of scribbling abbreviations of errors on paper, and permits error messages and source code to be viewed simultaneously without machinations of multiple windows in a screen editor. ... Error knows about the error messages produced by: make, cc, cpp, ccom, as, ld, lint, pi, pc, f77, and DEC Western Research Modula-2. You can get the sources to error from uunet via anonymous ftp (or anonymous ftp, whatever) in the directory ~ftp/bsd-sources/src/ucb/error. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710