BSD 4_2 development
[unix-history] / usr / man / man1 / error.1
CommitLineData
052f7690
C
1.TH ERROR 1 "18 January 1983"
2.UC 4
3.SH NAME
4error \- analyze and disperse compiler error messages
5.SH SYNOPSIS
6.B error
7[
8.B \-n
9] [
10.B \-s
11] [
12.B \-q
13] [
14.B \-v
15] [
16.B \-t
17suffixlist
18] [
19.B \-I
20ignorefile
21] [ name ]
22.SH DESCRIPTION
23.I Error
24analyzes and optionally disperses the diagnostic error messages
25produced by a number of compilers and language processors to the source
26file and line where the errors occurred. It can replace the painful,
27traditional methods of scribbling abbreviations of errors on paper, and
28permits error messages and source code to be viewed simultaneously
29without machinations of multiple windows in a screen editor.
30.PP
31.I Error
32looks at the error messages,
33either from the specified file \fIname\fR
34or from the standard input,
35and attempts to determine which
36language processor produced each error message,
37determines the source file and line number to which the error message refers,
38determines if the error message is to be ignored or not,
39and inserts the (possibly slightly modified) error message into
40the source file as a comment on the line preceding to which the
41line the error message refers.
42Error messages which can't be categorized by language processor
43or content are not inserted into any file,
44but are sent to the standard output.
45.I Error
46touches source files only after all input has been read.
47By specifying the
48.B \-q
49query option,
50the user is asked to confirm any potentially
51dangerous (such as touching a file) or verbose action.
52Otherwise
53.I error
54proceeds on its merry business.
55If the
56.B \-t
57touch option and associated suffix list is given,
58.I error
59will restrict itself to touch only those files with suffices
60in the suffix list.
61Error also can be asked (by specifying
62.B \-v)
63to invoke
64.IR vi (1)
65on the files in which error messages were inserted; this obviates
66the need to remember the names of the files with errors.
67.PP
68.I Error
69is intended to be run
70with its standard input
71connected via a pipe to the error message source.
72Some language processors put error messages on their standard error file;
73others put their messages on the standard output.
74Hence, both error sources should be piped together into
75.I error.
76For example, when using the \fIcsh\fP syntax,
77.IP
78make \-s lint |\|& error \-q \-v
79.LP
80will analyze all the error messages produced
81by whatever programs
82.I make
83runs when making lint.
84.PP
85.I Error
86knows about the error messages produced by:
87.I make,
88.I cc,
89.I cpp,
90.I ccom,
91.I as,
92.I ld,
93.I lint,
94.I pi,
95.I pc
96and
97.I f77.
98.I Error
99knows a standard format for error messages produced by
100the language processors,
101so is sensitive to changes in these formats.
102For all languages except
103.I Pascal,
104error messages are restricted to be on one line.
105Some error messages refer to more than one line in more than
106one files;
107.I error
108will duplicate the error message and insert it at
109all of the places referenced.
110.PP
111.I Error
112will do one of six things with error messages.
113.TP 10
114.I synchronize
115Some language processors produce short errors describing
116which file it is processing.
117.I Error
118uses these to determine the file name for languages that
119don't include the file name in each error message.
120These synchronization messages are consumed entirely by
121.I error.
122.TP 10
123.I discard
124Error messages from
125.I lint
126that refer to one of the two
127.I lint
128libraries,
129.I /usr/lib/llib-lc
130and
131.I /usr/lib/llib-port
132are discarded,
133to prevent accidently touching these libraries.
134Again, these error messages are consumed entirely by
135.I error.
136.TP 10
137.I nullify
138Error messages from
139.I lint
140can be nullified if they refer to a specific function,
141which is known to generate diagnostics which are not interesting.
142Nullified error messages are not inserted into the source file,
143but are written to the standard output.
144The names of functions to ignore are taken from
145either the file named
146.I .errorrc
147in the users's home directory,
148or from the file named by the
149.B \-I
150option.
151If the file does not exist,
152no error messages are nullified.
153If the file does exist, there must be one function
154name per line.
155.TP 10
156.I not file specific
157Error messages that can't be intuited are grouped together,
158and written to the standard output before any files are touched.
159They will not be inserted into any source file.
160.TP 10
161.I file specific
162Error message that refer to a specific file,
163but to no specific line,
164are written to the standard output when
165that file is touched.
166.TP 10
167.I true errors
168Error messages that can be intuited are candidates for
169insertion into the file to which they refer.
170.PP
171Only true error messages are candidates for inserting into
172the file they refer to.
173Other error messages are consumed entirely by
174.I error
175or are written to the standard output.
176.I Error
177inserts the error messages into the source file on the line
178preceding the line the language processor found in error.
179Each error message is turned into a one line comment for the
180language,
181and is internally flagged
182with the string ``###'' at
183the beginning of the error,
184and ``%%%'' at the end of the error.
185This makes pattern searching for errors easier with an editor,
186and allows the messages to be easily removed.
187In addition, each error message contains the source line number
188for the line the message refers to.
189A reasonably formatted source program can be recompiled
190with the error messages still in it,
191without having the error messages themselves cause future errors.
192For poorly formatted source programs in free format languages,
193such as C or Pascal,
194it is possible to insert a comment into another comment,
195which can wreak havoc with a future compilation.
196To avoid this, programs with comments and source
197on the same line should be formatted
198so that language statements appear before comments.
199.PP
200Options available with
201.I error
202are:
203.TP 5
204.B \-n
205Do
206.I not
207touch any files; all error messages are sent to the
208standard output.
209.TP 5
210.B \-q
211The user is
212.I queried
213whether s/he wants to touch the file.
214A ``y'' or ``n'' to the question is necessary to continue.
215Absence of the
216.B \-q
217option implies that all referenced files
218(except those referring to discarded error messages)
219are to be touched.
220.TP 5
221.B \-v
222After all files have been touched,
223overlay the visual editor
224.I vi
225with it set up to edit all files touched,
226and positioned in the first touched file at the first error.
227If
228.I vi
229can't be found, try
230.I ex
231or
232.I ed
233from standard places.
234.TP 5
235.B \-t
236Take the following argument as a suffix list.
237Files whose suffixes do not appear in the suffix list are not touched.
238The suffix list is dot separated, and ``*'' wildcards work.
239Thus the suffix list:
240.IP
241\& ".c.y.foo*.h"
242.IP
243allows
244.I error
245to touch files ending with ``.c'', ``.y'', ``.foo*'' and ``.y''.
246.TP 5
247.B \-s
248Print out
249.I statistics
250regarding the error categorization.
251Not too useful.
252.PP
253.I Error
254catches interrupt and terminate signals,
255and if in the insertion phase,
256will orderly terminate what it is doing.
257.SH AUTHOR
258Robert Henry
259.SH FILES
260.ta 2i
261~/.errorrc function names to ignore for \fIlint\fP error messages
262.br
263/dev/tty user's teletype
264.SH BUGS
265.PP
266Opens the teletype directly to do user querying.
267.PP
268Source files with links make a new copy of the file with
269only one link to it.
270.PP
271Changing a language processor's format of error messages
272may cause
273.I error
274to not understand the error message.
275.PP
276.I Error,
277since it is purely mechanical,
278will not filter out subsequent errors caused by `floodgating'
279initiated by one syntactically trivial error.
280Humans are still much better at discarding these related errors.
281.PP
282Pascal error messages belong after the lines affected
283(error puts them before). The alignment of the `\||\|' marking
284the point of error is also disturbed by
285.I error.
286.PP
287.I Error
288was designed for work on CRT's at reasonably high speed.
289It is less pleasant on slow speed terminals, and has never been
290used on hardcopy terminals.