BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / error.0
CommitLineData
362b077f
C
1
2
3
4ERROR(1) UNIX Programmer's Manual ERROR(1)
5
6
7
8N\bNA\bAM\bME\bE
9 error - analyze and disperse compiler error messages
10
11S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
12 e\ber\brr\bro\bor\br [ -\b-n\bn ] [ -\b-s\bs ] [ -\b-q\bq ] [ -\b-v\bv ] [ -\b-t\bt suffixlist ] [ -\b-I\bI
13 ignorefile ] [ name ]
14
15D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
16 _\bE_\br_\br_\bo_\br analyzes and optionally disperses the diagnostic error
17 messages produced by a number of compilers and language pro-
18 cessors to the source file and line where the errors
19 occurred. It can replace the painful, traditional methods
20 of scribbling abbreviations of errors on paper, and permits
21 error messages and source code to be viewed simultaneously
22 without machinations of multiple windows in a screen editor.
23
24 _\bE_\br_\br_\bo_\br looks at the error messages, either from the specified
25 file _\bn_\ba_\bm_\be or from the standard input, and attempts to deter-
26 mine which language processor produced each error message,
27 determines the source file and line number to which the
28 error message refers, determines if the error message is to
29 be ignored or not, and inserts the (possibly slightly modi-
30 fied) error message into the source file as a comment on the
31 line preceding to which the line the error message refers.
32 Error messages which can't be categorized by language pro-
33 cessor or content are not inserted into any file, but are
34 sent to the standard output. _\bE_\br_\br_\bo_\br touches source files
35 only after all input has been read. By specifying the -\b-q\bq
36 query option, the user is asked to confirm any potentially
37 dangerous (such as touching a file) or verbose action. Oth-
38 erwise _\be_\br_\br_\bo_\br proceeds on its merry business. If the -\b-t\bt
39 touch option and associated suffix list is given, _\be_\br_\br_\bo_\br will
40 restrict itself to touch only those files with suffices in
41 the suffix list. Error also can be asked (by specifying -\b-v\bv)\b)
42 to invoke _\bv_\bi(1) on the files in which error messages were
43 inserted; this obviates the need to remember the names of
44 the files with errors.
45
46 _\bE_\br_\br_\bo_\br is intended to be run with its standard input con-
47 nected via a pipe to the error message source. Some
48 language processors put error messages on their standard
49 error file; others put their messages on the standard out-
50 put. Hence, both error sources should be piped together
51 into _\be_\br_\br_\bo_\br. For example, when using the _\bc_\bs_\bh syntax,
52
53 make -s lint |& error -q -v
54
55 will analyze all the error messages produced by whatever
56 programs _\bm_\ba_\bk_\be runs when making lint.
57
58 _\bE_\br_\br_\bo_\br knows about the error messages produced by: _\bm_\ba_\bk_\be, _\bc_\bc,
59 _\bc_\bp_\bp, _\bc_\bc_\bo_\bm, _\ba_\bs, _\bl_\bd, _\bl_\bi_\bn_\bt, _\bp_\bi, _\bp_\bc, _\bf_\b7_\b7, and _\bD_\bE_\bC _\bW_\be_\bs_\bt_\be_\br_\bn
60
61
62
63Printed 7/9/88 May 5, 1986 1
64
65
66
67
68
69
70ERROR(1) UNIX Programmer's Manual ERROR(1)
71
72
73
74 _\bR_\be_\bs_\be_\ba_\br_\bc_\bh _\bM_\bo_\bd_\bu_\bl_\ba-_\b2. _\bE_\br_\br_\bo_\br knows a standard format for error
75 messages produced by the language processors, so is sensi-
76 tive to changes in these formats. For all languages except
77 _\bP_\ba_\bs_\bc_\ba_\bl, error messages are restricted to be on one line.
78 Some error messages refer to more than one line in more than
79 one files; _\be_\br_\br_\bo_\br will duplicate the error message and insert
80 it at all of the places referenced.
81
82 _\bE_\br_\br_\bo_\br will do one of six things with error messages.
83
84 _\bs_\by_\bn_\bc_\bh_\br_\bo_\bn_\bi_\bz_\be
85 Some language processors produce short errors
86 describing which file it is processing. _\bE_\br_\br_\bo_\br
87 uses these to determine the file name for
88 languages that don't include the file name in each
89 error message. These synchronization messages are
90 consumed entirely by _\be_\br_\br_\bo_\br.
91
92 _\bd_\bi_\bs_\bc_\ba_\br_\bd Error messages from _\bl_\bi_\bn_\bt that refer to one of the
93 two _\bl_\bi_\bn_\bt libraries, /_\bu_\bs_\br/_\bl_\bi_\bb/_\bl_\bl_\bi_\bb-_\bl_\bc and
94 /_\bu_\bs_\br/_\bl_\bi_\bb/_\bl_\bl_\bi_\bb-_\bp_\bo_\br_\bt are discarded, to prevent
95 accidently touching these libraries. Again, these
96 error messages are consumed entirely by _\be_\br_\br_\bo_\br.
97
98 _\bn_\bu_\bl_\bl_\bi_\bf_\by Error messages from _\bl_\bi_\bn_\bt can be nullified if they
99 refer to a specific function, which is known to
100 generate diagnostics which are not interesting.
101 Nullified error messages are not inserted into the
102 source file, but are written to the standard out-
103 put. The names of functions to ignore are taken
104 from either the file named ._\be_\br_\br_\bo_\br_\br_\bc in the users's
105 home directory, or from the file named by the -\b-I\bI
106 option. If the file does not exist, no error mes-
107 sages are nullified. If the file does exist,
108 there must be one function name per line.
109
110 _\bn_\bo_\bt _\bf_\bi_\bl_\be _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc
111 Error messages that can't be intuited are grouped
112 together, and written to the standard output
113 before any files are touched. They will not be
114 inserted into any source file.
115
116 _\bf_\bi_\bl_\be _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc
117 Error message that refer to a specific file, but
118 to no specific line, are written to the standard
119 output when that file is touched.
120
121 _\bt_\br_\bu_\be _\be_\br_\br_\bo_\br_\bs
122 Error messages that can be intuited are candidates
123 for insertion into the file to which they refer.
124
125
126
127
128
129Printed 7/9/88 May 5, 1986 2
130
131
132
133
134
135
136ERROR(1) UNIX Programmer's Manual ERROR(1)
137
138
139
140 Only true error messages are candidates for inserting into
141 the file they refer to. Other error messages are consumed
142 entirely by _\be_\br_\br_\bo_\br or are written to the standard output.
143 _\bE_\br_\br_\bo_\br inserts the error messages into the source file on the
144 line preceding the line the language processor found in
145 error. Each error message is turned into a one line comment
146 for the language, and is internally flagged with the string
147 ``###'' at the beginning of the error, and ``%%%'' at the
148 end of the error. This makes pattern searching for errors
149 easier with an editor, and allows the messages to be easily
150 removed. In addition, each error message contains the
151 source line number for the line the message refers to. A
152 reasonably formatted source program can be recompiled with
153 the error messages still in it, without having the error
154 messages themselves cause future errors. For poorly format-
155 ted source programs in free format languages, such as C or
156 Pascal, it is possible to insert a comment into another com-
157 ment, which can wreak havoc with a future compilation. To
158 avoid this, programs with comments and source on the same
159 line should be formatted so that language statements appear
160 before comments.
161
162 Options available with _\be_\br_\br_\bo_\br are:
163
164 -\b-n\bn Do _\bn_\bo_\bt touch any files; all error messages are sent to
165 the standard output.
166
167 -\b-q\bq The user is _\bq_\bu_\be_\br_\bi_\be_\bd whether s/he wants to touch the
168 file. A ``y'' or ``n'' to the question is necessary to
169 continue. Absence of the -\b-q\bq option implies that all
170 referenced files (except those referring to discarded
171 error messages) are to be touched.
172
173 -\b-v\bv After all files have been touched, overlay the visual
174 editor _\bv_\bi with it set up to edit all files touched, and
175 positioned in the first touched file at the first
176 error. If _\bv_\bi can't be found, try _\be_\bx or _\be_\bd from stan-
177 dard places.
178
179 -\b-t\bt Take the following argument as a suffix list. Files
180 whose suffixes do not appear in the suffix list are not
181 touched. The suffix list is dot separated, and ``*''
182 wildcards work. Thus the suffix list:
183
184 ".c.y.foo*.h"
185
186 allows _\be_\br_\br_\bo_\br to touch files ending with ``.c'', ``.y'',
187 ``.foo*'' and ``.y''.
188
189 -\b-s\bs Print out _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs regarding the error categoriza-
190 tion. Not too useful.
191
192
193
194
195Printed 7/9/88 May 5, 1986 3
196
197
198
199
200
201
202ERROR(1) UNIX Programmer's Manual ERROR(1)
203
204
205
206 _\bE_\br_\br_\bo_\br catches interrupt and terminate signals, and if in the
207 insertion phase, will orderly terminate what it is doing.
208
209A\bAU\bUT\bTH\bHO\bOR\bR
210 Robert Henry
211
212F\bFI\bIL\bLE\bES\bS
213 ~/.errorrc function names to ignore for _\bl_\bi_\bn_\bt error
214 messages
215 /dev/tty user's teletype
216
217B\bBU\bUG\bGS\bS
218 Opens the teletype directly to do user querying.
219
220 Source files with links make a new copy of the file with
221 only one link to it.
222
223 Changing a language processor's format of error messages may
224 cause _\be_\br_\br_\bo_\br to not understand the error message.
225
226 _\bE_\br_\br_\bo_\br, since it is purely mechanical, will not filter out
227 subsequent errors caused by `floodgating' initiated by one
228 syntactically trivial error. Humans are still much better
229 at discarding these related errors.
230
231 Pascal error messages belong after the lines affected (error
232 puts them before). The alignment of the `|' marking the
233 point of error is also disturbed by _\be_\br_\br_\bo_\br.
234
235 _\bE_\br_\br_\bo_\br was designed for work on CRT's at reasonably high
236 speed. It is less pleasant on slow speed terminals, and has
237 never been used on hardcopy terminals.
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261Printed 7/9/88 May 5, 1986 4
262
263
264