Path: utzoo!utgpu!watserv1!watmath!att!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!portal!cup.portal.com!Rick_R_Kitts From: Rick_R_Kitts@cup.portal.com Newsgroups: comp.lang.c++ Subject: Re: Problems of Zortech C++ v2.1 Message-ID: <31714@cup.portal.com> Date: 14 Jul 90 18:17:47 GMT References: <82035@tut.cis.ohio-state.edu> Distribution: na Organization: The Portal System (TM) Lines: 67 This is a story of me vs. Zortech 2.06. I recently started a new job, and my first task was to move a bunch of C code into C++. This move was being done at my urging so it was important everything go reasonably smoothly (you know what I mean). Anyway, I do my designing and everyone is happy. Time to code. As it turns out we have Zortech 2.06 as the C++ compiler we will be using. I code away and in a little while I have the thing compiling (Yay!). I start testing and discover that I can't do a cast from an unsigned short to double without an error. (e.g. short has value 32769, after assignment (with cast) double has a value of 32770). I also discover this is range dependant (e.g. 1401 casts just fine, but the bigger the number the worse the error). I had remembered that there was some mention of floating point in the READ.ME file. This file says that the floating point emulator does not use IEEE format floats yet (luckily I don't have a co-processor or I may never have seen this). Well wonderful. We do analysis of financial data, and people generally get peeved when dollars randomly appear and disappear. Thinking that I would provide a work around of some sort I decide to overload the member function of the class which I am working on. I now had to member functions with the following prototypes: SetFieldVal(int, double) SetFieldVal(int, unsigned short) Ok, I recompile and Zortech yells about an ambiguous function definition and throws up. Hmm says I. Now, I let this pass for the moment and remove the overload. I'm then fiddling with something else, a member function which returns a pointer to a dynamically allocated object. For one reason or another I change this to returning a pointer to a static object. Zortech gets through pass 1, and then pass 2, and finally says "ZTC bug: 9513". Hmm again says I. At this point I was becoming a bit concerned. Had I made some crucial, but hard to detect errors in my code? Was the ambiguous function error related to the problem I was now seeing? I'm far from and expert C++ programmer and of course suspected pilot as opposed to plane errors. Anyway I mucked about with this for a day. By the end of the day I had pretty much decided that I wasn't the problem. My boss however was concerned that perhaps the C++ move wasn't a good idea and that we all needed a bit more exerience with the language (he was quite diplomatic about the whole thing, even though I was feeling a little stupid). Luckily I happen to have a CFRONT at home. Its based on 1.1 of the language, but I hadn't used any 2isms in my code yet. So I took the code home to run through my CFRONT. Well, well, well. Everything works just fine. No ambiguous function errors, no problems with static objects, nothing. Armed with this information I convince my boss that we should by Turbo C++. At this point he was still quite skeptical, and I, although confident in my determination, was sweating bullets. So he gives me a check and I run down and buy Turbo C++. Run back to the office, install, set a few things up, cross my fingers, rub my rabbits foot, etc. and start the compile. Voila! An executable file! And it works. Same exact code as that given to Zortech. Happiness lives once again at work. I have thrown out Zortech altogether. BTW, I did call Zortech about the ZTC bug message. I was told that it was usually a user problem and in any case the number didn't mean anything since it was a random number. For me at least, the moral of the story is that Zortech is a nice toy. It does fast compiles, and the debugger is useful. I can't see using it as something to make money with. And I absolutely will never, ever, ever, risk my reputation on any Zortech product again. ---Rick Rick_R_Kitts@portal.cup.com rkitts@slc.slac.stanford.edu