Checksum: 37290
Path: utzoo!utgpu!dennis
From: dennis@gpu.utcs.toronto.edu (Dennis Ferguson)
Date: Wed, 30-Nov-88 14:46:44 EST
Message-ID: <1988Nov30.144644.11033@gpu.utcs.toronto.edu>
Organization: Mechanical Engineering, University of Toronto
Newsgroups: comp.sys.ibm.pc.rt
Subject: Re: Inquiries for "Bad Aspects" of the RT
References: <7963@dasys1.UUCP> <815@kimbal.UUCP> <3707@pt.cs.cmu.edu>
Reply-To: dennis@gpu.utcs.toronto.edu (Dennis Ferguson)
Keywords: hc MetaWare compilers ANSI

In article <3707@pt.cs.cmu.edu> jgm@k.gp.cs.cmu.edu (John Myers) writes:
> hc claims to be draft ANSI conformant, but really doesn't come close.
> A large number of Makefiles invoke hc with the "-U__STDC__" switch as
> a matter of course and a number of system-wide header files have
> constructs surrounded by "#if defined(__STDC__) && !defined(__HIGHC__)".

Hc really is draft ANSI conformant if you let it use its own preprocessor.
The problem is that by default, in deference to all the system code
which just won't compile with an ANSI compiler, hc uses /lib/cpp
instead.  The bug is that it defines __STDC__ even when using the
nonstandard preprocessor.

>hc has a number of bugs--the usual method of compiling a program is to
>run a "make", compiling what one can with hc, and then doing a 
>"make CC=pcc" to compile the rest.  Sometimes this won't work--I have
>one program that I simply cannot compile on the RT because it tickles
>bugs in both compilers.  Most of the bugs I reported seem to be fixed
>in the latest release, but from what I read on the xperts mailing
>list, the latest release still has problems.

Hc does have bugs (I also have programs I can't compile on the RT), but
I find that failures to compile are most often a result of some pretty
dubious (i.e. definitely non-ANSI) code.  The compiler is quite strict
(perhaps to a fault) and complains about things that even lint misses.
It is a very good compiler if you want to do development of code you want
to be portable, though, since if you can get it through hc without complaint
you can be pretty sure it will compile anywhere.  I like hc (sans bugs),
but I realize the strictness isn't everyone's cup of tea.  Pcc does have
the merit of hardly ever complaining no matter how bad the stuff it's
compiling is, and I also use it if I don't care enough about what I'm
compiling to look and see what is wrong.

Dennis Ferguson
University of Toronto