Path: utzoo!attcan!uunet!lll-winken!brutus.cs.uiuc.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!pro-generic.cts.com!sysop From: sysop@pro-generic.cts.com (Matthew Montano) Newsgroups: comp.sys.apple Subject: ORCA/C Bugs.. or FEATURES?! Message-ID: <8910190700.AA14944@trout.nosc.mil> Date: 19 Oct 89 05:45:28 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 73 I found an interesting bug in ORCA/C's compiler today: Try placing a return on a line by itself without the terminating ";" for the line. If the following line is a simple assignment operator (x=10 etc.) then it will compile and work correctly without the ";", with a flow control operator after it (while, for etc.) it will error out on the compile. Whether this is related to this problem, I am unsure, but this program below does NOT work. No matter what I try, it crashes into the monitor on the return in all occurences under finddevice. --- #pragma keep "fd" #include main() { word requestid; int devid; struct DInfoRec myDInfo; requestid = 0x0009; devid = finddevice(requestid); printf("Correct device (with ID requested):%d",devid); exit(); } finddevice(requestid) word requestid; { struct DInfoRec myDInfo; int myerror, miscint; printf("requested id %d\n", requestid); miscint = requestid; /* requestid looses value as soon as we exit */ /* finddevice with DInfo(blah) */ myerror = 0; myDInfo.pCount = 10; myDInfo.devNum = 1; while (myerror == 0) { printf("Checking %d\n", myDInfo.devNum); DInfoGS(&myDInfo); if (toolerror()) { printf("Toolerror %x",toolerror()); myerror = 1; return(0); } printf("DevID:%x DevNum:%d\n",myDInfo.deviceID, myDInfo.devNum); if (myDInfo.deviceID == miscint) { printf("Found device!"); return(myDInfo.devNum); } myDInfo.devNum++; } } --- It simply crashes.. every single time, even if I want to return nothing to the main() subprogram. If I place a return before the DInfo call, it returns correctly. Is there something I should call before I place the call to DInfo within the function to allow it to function correctly? I do believe that the ORCA/C compiler is missing many checks for error checking, assuming the perfect programmer is a real poor assumption. I used the first version of Turbo C on the Messy-Dos machines and had nearly all my poor thinking flagged even before it thought about linking it! I must admit that the documentation is decent and the price was resonable, but it has to work.. Is APW C worth the $25 more? UUCP: crash!pro-generic!sysop ARPA: crash!pro-generic!sysop@nosc.mil INET: sysop@pro-generic.cts.com