Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!csd4.csd.uwm.edu!uxc.cso.uiuc.edu!tank!uwvax!puff!rt18.cs.wisc.edu!blochowi From: blochowi@rt18.cs.wisc.edu (Jason Blochowiak) Newsgroups: comp.sys.apple Subject: Re: C development environment for IIGS Keywords: C,IIGS,development Message-ID: <2940@puff.cs.wisc.edu> Date: 8 Sep 89 02:09:06 GMT References: <197@fjcp60.GOV> Sender: news@puff.cs.wisc.edu Reply-To: blochowi@rt18.cs.wisc.edu (Jason Blochowiak) Organization: U of Wisconsin CS Dept Lines: 80 In article <197@fjcp60.GOV> brinkema@fjcnet.GOV (John R. Brinkema) writes: >I am about to purchase a C development enviroment (C compiler, plus >friends) to do some software development on my IIGS. I am interested >in what the experienced developers recommend. > >I am a very experienced C programmer (a lot under UNIX, some on a >Mac using THINK's Lightspeed C .. which I like a lot!). Of course I >have a IIGS, a hard disk, 1.25 M memory, but little else other than >a great deal of interest. > tnx. jb Well, don't get your hopes up too much... Both of the C compilers available for the //gs are mediocre at best. There's APW C, which seems to be a port of Megamax C with a 65816 code generator stuck on the end, and Orca/C which (as far as I know) is a complete from-scratch compiler. Both are buggy. According to a friend (I haven't checked it yet), if you do "a += 1.0" where a is a float, APW C will generate code that crashes. Orca/C is worse - on every program that I've written, I've discovered a new bug - the worst is that they're so basic, I'm frightened about how many subtle bugs will be generated. Two blatant examples: In one program, I do a switch (char variable) with a few cases and a default. The compiler either 1) Didn't generate the code associated with the default clause (what, a parse tree with dutch elm disease? Look, ma, another branch just fell off...), or 2) Just didn't generate the proper branch. I didn't poke that far into the disassembly (just far enough to figure out that it was the compiler, and not my code or my imagination). The second example: typedef struct { int junk } x; x bug[] = {{1},{2},{3}}; main() { int i; for (i = 0;i < 3;i++) printf("%d ",bug[i]); } The program will print out "1 1 1 ". What happened was at some point the compiler decided that (sizeof(x) == 0). If the array is dimensioned, e.g. "x bug[3] = ..." the code works as it should. The Orca/C libraries are much smaller than APW C's - I haven't had much reason to check if they work. printf(), gets(), and atof() appear to work as advertised... By smaller, I mean the code is smaller - they appear to have the complete ANSI C library routines. Neither of them is particularly speedy, but with a TransWarp GS, they're tolerable (without one, though, you'll develop new "waiting for the compiler" habits). I think that Orca/C is faster, but haven't done any testing. Orca/C comes with a (buggy to the point of uselessness) desktop environment, as well as an (fairly bug free) APW compatible text-based shell (the desktop environment also allows access to the shell). APW C requires the APW shell (which also includes a pretty nice macro assembler and some other utilities). The desktop environment includes a (Pascal oriented, although not much) source level debugger, in which there are also bugs (either that, or Orca/C creates bad information for it). There's a text based debugger for APW (when I say APW, I'm referring to the APW shell as well as the text-based Orca shell) that's pretty nice, considering its simplicity (it's not even symbolic). Orca/C allows you to create NDAs and CDAs as well as normal programs (EXE & S16). APW C requires a bunch of weird shit with setjmp to support NDAs, and can't be used to write CDAs. Orca/C also supports more calling conventions, which make doing certain things more convenient. Basically, Orca/C has more "stuff", but is significantly buggier than APW C. APW C is also not ANSI compatible (no function prototyping...). Oh, speaking of function prototyping, Orca/C doesn't allow prototyping toolbox calls, which is really annoying, considering the large number of calls in a standard desktop program. Neither is great, but they work, sort of... If you (or somebody else) has more questions, ask away... Jason