Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!iggy.GW.Vitalink.COM!widener!msi.umn.edu!cs.umn.edu!kksys!wd0gol!rathe!ian From: ian@rathe.cs.umn.edu (Ian Hogg) Newsgroups: comp.lang.c++ Subject: Re: C++ and the DEC Station Message-ID: <1991Apr25.183306.767@rathe.cs.umn.edu> Date: 25 Apr 91 18:33:06 GMT References: <2608@otc.otca.oz> Organization: Rathe, Inc. Lines: 69 In article <2608@otc.otca.oz> grahamd@otc.otca.oz.au (Graham Dumpleton) writes: > > >I recently posted asking about Glockenspiel C++ for the DEC Station. In >particular whether it had the AT&T tasking library. The responses I got >indicated that it didn't. I did find out though that Oregon and Oasys sell >a version of C++ for the DEC Station which does have the tasking library. >Has anyone used these companies ports of AT&T's cfront. Are they okay or >are they buggy. > I don't think Oregon's is a port of cfront. I used it on HP and had to quit using it for the following reason: I was porting an application from C to C++. It depended on a C library compiled with HP's C compiler. It turned out that at least one of the functions had a parameter who via several levels of typedef's was a short. The client program (compiled with Oregon) used sizeof(short) bytes on the stack to pass the parameter. HP expects to use sizeof(short) out of sizeof(int) bytes. This caused all kinds of problems ( program crashed). And could only be resolved by going down to the lowest level of typedef and changing it to int. Oregon had to command line switches or anything to modify this behavior (except running in K&R mode which is real useful for C++ code) Oregon response to the problem was something like "the spec says we can do it this way so were are not going to change". I think that a 3rd party compiler vendor ought to make sure code they generate is compatable with libraries compiled with the native compiler (C compiler at least). There is no way I am going to debug all include files I get from HP, Oracle, etc. to make sure they don't contain shorts and God knows what else. If you are thinking about purchasing Oregon C++ please make sure you will not get caught by the above bug. Here is a small example program that shows the problem: /* Compile this with Native C compiler */ #include void foobar(s) short s; { printf("It is %d\n",s); } // Compile this with occ extern "C" void foobar(short s); main() { short s2 = 1; foobar(s2); } >Any comments would be appreciated. > >-- >Graham Dumpleton (grahamd@otc.otca.oz.au) Sorry for the extensive babbling but I feel that this is a serious problem with the product and causes hard to find errors. -- Ian Hogg email: rathe!ian@cs.umn.edu ...!umn-cs!rathe!ian Rathe, Inc ianhogg@cs.umn.edu 366 Jackson Street phone: (612) 225-1401