1ERROR(1) General Commands Manual ERROR(1)
2
3
4
6 error - analyze and disperse compiler error messages
7
9 error [ -n ] [ -s ] [ -q ] [ -v ] [ -t suffixlist ] [ -I ignorefile ] [
10 name ]
11
13 Error analyzes and optionally disperses the diagnostic error messages
14 produced by a number of compilers and language processors to the source
15 file and line where the errors occurred. It can replace the painful,
16 traditional methods of scribbling abbreviations of errors on paper, and
17 permits error messages and source code to be viewed simultaneously
18 without machinations of multiple windows in a screen editor.
19
20 Error looks at the error messages, either from the specified file name
21 or from the standard input, and attempts to determine which language
22 processor produced each error message, determines the source file and
23 line number to which the error message refers, determines if the error
24 message is to be ignored or not, and inserts the (possibly slightly
25 modified) error message into the source file as a comment on the line
26 preceding to which the line the error message refers. Error messages
27 which can't be categorized by language processor or content are not
28 inserted into any file, but are sent to the standard output. Error
29 touches source files only after all input has been read. By specifying
30 the -q query option, the user is asked to confirm any potentially dan‐
31 gerous (such as touching a file) or verbose action. Otherwise error
32 proceeds on its merry business. If the -t touch option and associated
33 suffix list is given, error will restrict itself to touch only those
34 files with suffices in the suffix list. Error also can be asked (by
35 specifying -v) to invoke vi(1) on the files in which error messages
36 were inserted; this obviates the need to remember the names of the
37 files with errors.
38
39 Error is intended to be run with its standard input connected via a
40 pipe to the error message source. Some language processors put error
41 messages on their standard error file; others put their messages on the
42 standard output. Hence, both error sources should be piped together
43 into error. For example, when using the csh syntax,
44
45 make -s lint |& error -q -v
46
47 will analyze all the error messages produced by whatever programs make
48 runs when making lint.
49
50 Error knows about the error messages produced by: make, cc, cpp, ccom,
51 as, ld, lint, pi, pc, f77, and DEC Western Research Modula-2. Error
52 knows a standard format for error messages produced by the language
53 processors, so is sensitive to changes in these formats. For all lan‐
54 guages except Pascal, error messages are restricted to be on one line.
55 Some error messages refer to more than one line in more than one files;
56 error will duplicate the error message and insert it at all of the
57 places referenced.
58
59 Error will do one of six things with error messages.
60
61 synchronize
62 Some language processors produce short errors describing
63 which file it is processing. Error uses these to determine
64 the file name for languages that don't include the file name
65 in each error message. These synchronization messages are
66 consumed entirely by error.
67
68 discard Error messages from lint that refer to one of the two lint
69 libraries, /usr/share/lint/llib-lc and /usr/share/lint/llib-
70 port are discarded, to prevent accidently touching these
71 libraries. Again, these error messages are consumed entirely
72 by error.
73
74 nullify Error messages from lint can be nullified if they refer to a
75 specific function, which is known to generate diagnostics
76 which are not interesting. Nullified error messages are not
77 inserted into the source file, but are written to the stan‐
78 dard output. The names of functions to ignore are taken from
79 either the file named .errorrc in the users's home directory,
80 or from the file named by the -I option. If the file does
81 not exist, no error messages are nullified. If the file does
82 exist, there must be one function name per line.
83
84 not file specific
85 Error messages that can't be intuited are grouped together,
86 and written to the standard output before any files are
87 touched. They will not be inserted into any source file.
88
89 file specific
90 Error message that refer to a specific file, but to no spe‐
91 cific line, are written to the standard output when that file
92 is touched.
93
94 true errors
95 Error messages that can be intuited are candidates for inser‐
96 tion into the file to which they refer.
97
98 Only true error messages are candidates for inserting into the file
99 they refer to. Other error messages are consumed entirely by error or
100 are written to the standard output. Error inserts the error messages
101 into the source file on the line preceding the line the language pro‐
102 cessor found in error. Each error message is turned into a one line
103 comment for the language, and is internally flagged with the string
104 ``###'' at the beginning of the error, and ``%%%'' at the end of the
105 error. This makes pattern searching for errors easier with an editor,
106 and allows the messages to be easily removed. In addition, each error
107 message contains the source line number for the line the message refers
108 to. A reasonably formatted source program can be recompiled with the
109 error messages still in it, without having the error messages them‐
110 selves cause future errors. For poorly formatted source programs in
111 free format languages, such as C or Pascal, it is possible to insert a
112 comment into another comment, which can wreak havoc with a future com‐
113 pilation. To avoid this, programs with comments and source on the same
114 line should be formatted so that language statements appear before com‐
115 ments.
116
117 Options available with error are:
118
119 -n Do not touch any files; all error messages are sent to the stan‐
120 dard output.
121
122 -q The user is queried whether s/he wants to touch the file. A ``y''
123 or ``n'' to the question is necessary to continue. Absence of the
124 -q option implies that all referenced files (except those refer‐
125 ring to discarded error messages) are to be touched.
126
127 -v After all files have been touched, overlay the visual editor vi
128 with it set up to edit all files touched, and positioned in the
129 first touched file at the first error. If vi can't be found, try
130 ex or ed from standard places.
131
132 -t Take the following argument as a suffix list. Files whose suf‐
133 fixes do not appear in the suffix list are not touched. The suf‐
134 fix list is dot separated, and ``*'' wildcards work. Thus the
135 suffix list:
136
137 ".c.y.foo*.h"
138
139 allows error to touch files ending with ``.c'', ``.y'', ``.foo*''
140 and ``.y''.
141
142 -s Print out statistics regarding the error categorization. Not too
143 useful.
144
145 Error catches interrupt and terminate signals, and if in the insertion
146 phase, will orderly terminate what it is doing.
147
149 Robert Henry
150
152 ~/.errorrc function names to ignore for lint error messages
153 /dev/tty user's teletype
154
156 Opens the teletype directly to do user querying.
157
158 Source files with links make a new copy of the file with only one link
159 to it.
160
161 Changing a language processor's format of error messages may cause
162 error to not understand the error message.
163
164 Error, since it is purely mechanical, will not filter out subsequent
165 errors caused by `floodgating' initiated by one syntactically trivial
166 error. Humans are still much better at discarding these related
167 errors.
168
169 Pascal error messages belong after the lines affected (error puts them
170 before). The alignment of the `|' marking the point of error is also
171 disturbed by error.
172
173 Error was designed for work on CRT's at reasonably high speed. It is
174 less pleasant on slow speed terminals, and has never been used on hard‐
175 copy terminals.
176
177
178
1794th Berkeley Distribution October 21, 1996 ERROR(1)