🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #74547

Student C compiler with good error messages

#74547
From: John Lees
Date: Mon, 18 Mar 1991 16:07
35 lines
2657 bytes
I teach an introductory course in C language programming, and am in the
process of switching from the native C compiler to gcc (this is on an
AT&T 3b2, so the process is not trivial).

I have been using gcc a lot recently, trying to isolate bugs in the
port, and have been comparing gcc's error messages with those of the
native C compiler. I'm not thrilled with either, especially with gcc's
common "parse error in line blah blah" message. This may be all I or
any other experienced programmer need as a clue to find a syntax
error, but it sure is confusing to a student just learning their way
around.

Now I do understand that error recovery and diagnosis in a compiler is
very tricky to pull off well. Furthermore, the sexy thing to do these
days is optimization, and the traditional UNIX attitude toward error
messages is that they are a waste of time (awk, for example, usually
makes its errors known by dying horribly and dumping core).

Does anyone else out there see a need for a "student C compiler", that
would have good error recovery and messages? This has been done for
other languages (ALGOL-W, WATFIV, PL/C) quite well, and is very useful
in a learning environment. And I suspect that considerable numbers of
people-years of effort could be saved by better error handling, even
for professional programmmers.

I'd also like to see an option to build gcc without any of the
optimization capabilities, again to produce a "student version" that
would use fewer system resources. (Don't yell at me to use Borland C
on a bunch of PCs. I want my students to begin learning the rather
complex UNIX working environment. Besides, I don't have a bunch of
PCs free for that purpose.)
----------
John Lees, Instructor, Computer Science Curriculum Coordinator
Lyman Briggs School, College of Natural Science, Michigan State University
lees@egr.msu.edu, lees@cps.msu.edu, lees@msuegr.bitnet, uunet!frith!lees
Technical Details
Message-ID: <1991Mar18.160755.4608@msuinfo.cl.msu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!ns-mx!iowasp.physics.uiowa.edu!ceres.physics.uiowa.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!netnews.upenn.edu!msuinfo!buster.cps.msu.edu!lees

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,bb27e38adc47ea3c,start
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1991-03-18 11:17:30 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!ns-mx!iowasp.physics.uiowa.edu!ceres.physics.uiowa.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!netnews.upenn.edu!msuinfo!buster.cps.msu.edu!lees
From: lees@cps.msu.edu (John Lees)
Newsgroups: gnu.misc.discuss
Subject: Student C compiler with good error messages
Message-ID: <1991Mar18.160755.4608@msuinfo.cl.msu.edu>
Date: 18 Mar 91 16:07:55 GMT
Sender: news@msuinfo.cl.msu.edu
Organization: Michigan State University, Lyman Briggs School
Lines: 35
Originator: lees@buster.cps.msu.edu