Error processing techniques
Brandon Allbery
allbery at ncoast.UUCP
Mon Oct 27 11:21:29 AEST 1986
Quoted from <765 at zeus.UUCP> ["Re: Seeking a Development Environment (Sun?)"], by bobr at zeus.UUCP (Robert Reed)...
+---------------
| In article <8422 at sun.uucp> guy at sun.uucp (Guy Harris) writes:
| >> (UNIX) does not have ... a C compiler which generates error messages
| >> incompatible with standard error postprocessing techniques. These may all
| >> be bugs...
| >
| >What does "standard error postprocessing techniques" mean?
|
| I expressed it that way because I didn't want to get into another vi/emacs
| argument. Vi users use "error" and emacs users (at least gosling/unipress)
| use next-error. In either case, it is an ad hoc standard (it has been
| propogated to many machines) and it's one more hurtle to hassle (via a
| filter or whatever) when migrating to the machine.
+---------------
Recently I had to do some coding on an Altos 1086 machine. The C compiler
(presumably a Microsoft C) produces error messages like the following:
filename.c(line) : error message
The machine also had a vi with the :map command. I set up the following map:
:map g G:s/^\([^(][^(]*\)(\([0-9][0-9]*\)) : .*$/:!vi +\2 \1/^V^M"cdd at c^V^M
This map incurs the expense of two vi's running at the same time, but will
process errors and position you on the line containing the error. The "g"
command fails at the end of the error list; it also follows the list backwards
to attempt to insure that other line numbers aren't thrown off by fixes that
delete or add lines. (I also have an initialization map which gets rid of
non-error lines and sticks a banner at the top of the buffer; this banner
serves the dual purpose of identifying the buffer and marking the end of the
error list. The macro was necessary because the Altos C compiler prints each
file name as it processes it, ALWAYS.) This kind of macro can be adapted to
any error scheme, as well as "grep" output, etc. Unfortunately, it's only as
portable as a vi with the :map command is.
++Brandon
--
---------------- /--/ Brandon S. Allbery UUCP: decvax!cwruecmp!
/ / /|\/ Tridelta Industries, Inc. ncoast!tdi2!brandon
---- -------- /-++ 7350 Corporate Blvd. PHONE: +1 216 974 9210
/ / /---, ---- Mentor, Ohio 44060 SYSOP: UNaXcess/ncoast
/ / / / / / -- HOME -- (216) 781-6201 24 hrs.
/ / / / / / 6615 Center St. Apt. A1-105 ARPA: ncoast!allbery%
---- -----~ ---- Mentor, Ohio 44060-4101 case.CSNET at relay.cs.net
More information about the Comp.unix.wizards
mailing list