Compiler Error Checking and Error Messages - How much is too much?

Don Steiny steiny at scc.UUCP
Sun Sep 15 06:20:28 AEST 1985


*** REPLACE THIS LINE WITH YOUR MESSAGE ***
***

	I have seen C compilers that do Pascal-like things and
try to point to the line and position of the error.   My opinion
is that this is inappropriate.  I have not had any trouble 
locating errors from the error message I get from the terse
compilers on version 6 & 7.   I even think that the 4.1 and
4.2 compilers are a bit wordy, but I don't mind too much.

	I used a compiler once that made assignment of pointer
to an int a FATAL ERROR.   Note that on this system both 
pointers and ints were 32 bits.  Since the compiler on the 
system I generally use, a Wollongong V7 port, does not even 
complain about it, it seems to me that making it completely 
illegal might break much exisiting code.  It certainly broke 
some of mine.  It seems like a strange thing to do to me, but
is it a bug or a useful feature?   It would force future
code to be more portable, but it would break some existing
C code.

	I can think of two solutions.   One would be to have
flags for the compiler that allowed compilation of code from
older compilers.   Compilers could also have a verbose or
non-verbose mode.  Another solution would be to have the compiler
do the best job it can compiling the code for the specific
machine it is for and have lint or a lint like tool do all
the portability checking.

	I favor the second solution.   But if flags are added,
I believe that non-verbose mode would be the most useful
default.  I find the verbose messages confusing, all I
need is the line number and I can spot the error right
away.   I think that using separate programs fits 
more in the UNIX philosophy of separate tools that
can be combined by users. 

	I would be interested to know what others think about
it. 
-- 
scc!steiny
Don Steiny @ Don Steiny Software 
109 Torrey Pine Terrace
Santa Cruz, Calif. 95060
(408) 425-0382



More information about the Comp.lang.c mailing list