[net.micro.cpm] C Compiler for CP/M-80?

db21@ihuxk.UUCP (Dave Beyerl) (07/16/84)

I am considering the possibility of purchasing a C compiler for use
on my home computer which has a cpm based operating system.  I have
read the articles in the August 83 issue of BYTE - The Unix C complier
in a CP/M Environment, and Five C Compilers for CP/M-80, and have 
reached a conclusion similar to Kern's about the five compilers he
reviewed, namely that the compiler should adhere to the Kernighan & 
Ritchie standard, perform compilations rapidly and have clean
implementation, and be reasonably priced.  Of the compilers mentioned
in the article, the Aztec, BDS and C/80 seem to fill the bill.

I would like to hear from anyone who has experience with these 
compilers preferably with more than one and can make a valid 
comparison.  I would also like to hear from anyone who might know
of a compiler that was not mentioned in the article, but meets the
criteria.  The upper price limit for this is about $250.

Mail replies to ihuxk!db21.  If there is sufficient response and/or
information not mentioned in the articles, I will try to summarize
for the net.  Thanks in advance for your help.
					Dave Beyerl

jr@foros1.UUCP (John Rogers) (07/18/84)

Hi.  I've been using C/80 (version 3.1, under CP/M) for a while, so
I guess I'll toss out a few comments.

Language:
	more or less full K&R, with some documented restrictions:
	no typedefs, no longs or floats (unless you get MATHPAK),
	no bit fields, no parameterized macros, no #line, no declarations
	within nested blocks.

	Big complaint number one: no parameterized macros.  This
	turns out to be more useful than I thought it would be.

	It also has an undocumented restriction: structures can't
	contain pointers to structures which haven't been declared
	yet.

Library:
	Incomplete.  It doesn't even have <stdio.h>!!!!!!  If you want
	to use "stdin", you have to declare it yourself.  No open() or
	close(), read() and write() can only do multiples of 128 bytes,
	no lseek() unless you buy MATHPAK (not sure if you get it then,
	but it would be easy to write).

	Big complaint number two: because of the order which
	subroutine arguments are pushed onto the stack (leftmost
	first), routines which get passed multiple parameters
	are implemented with a "kluge" (their word) which involves
	#defines to call TWO routines, one of which saves information
	about the top of the stack, for the other.  This affects
	every routine which calls printf, for instance.

Quality of compiler and code produced:
	No complaints.  I haven't run anything big enough to get
	a feel for how fast or how large the generated code is.

Overall impression:
	Still a bargain for $50.  What this compiler really needs
	are (1) a full preprocessor (which there are a couple of
	public domain implementations in the works), and (2) and
	complete runtime library (which is also in the works,
	although it looks like it won't be public domain).

I hope this helps.  If you have any questions or whatever, just drop
me a line.

				See ya!
-- 
				JR (John Rogers)
				...ihnp4!fortune!foros1!jr
				also fortune!jr and proper!jr

leisner.henr@XEROX.ARPA (07/20/84)

Dave,

I've used BDS C and Aztec C on a Xerox 820 (I've also used Whitesmith's
C and Small C).  BDS C is lightening fast to compile, seems to produce
reasonably efficient code but I don't trust it (I once developed a
program on another C compiler and ported it over to CP/M and BDS made me
crazy).  I'd recommend it for doing developed on the compiler but don't
trust it for portable code.  Friends of mine have told me it misses some
obvious errors.  It also is a limited implementation (i.e.  cannot
define static arrays with data at allocation time).

Aztec seems to be the best of all worlds -- reasonably fast compiles,
reasonably efficient code, Unix compatibility.  The only complaint I
have with Aztec is their library source is generally uncommented
(especially the assembly language written stuff).

Whitesmiths is a product I cannot say a good word about.  It's
expensive, it takes forever to compile, it takes up enormous amounts of
space (I think printf("Hello world" is 18 k of 8080 object code), the
older versions I/O is not Unix compatible and the documentation is
unreadable.  Stay away from it by all means unless newer versions are
different than the one I'm using.

All in all, Aztec is very recommended as being Unix compatible.  BDS is
recommended with a grain of salt, but it is great for hacking out one
day programs since it compiles so fast.

Hope I've helped.

Marty.