Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rochester!cornell!vax1!wvpj From: wvpj@vax1.UUCP (Marc Parmet) Newsgroups: comp.lang.c Subject: Re: Trouble with Greenhill's C compiler Message-ID: <448@vax1.UUCP> Date: Sun, 2-Aug-87 19:01:26 EDT Article-I.D.: vax1.448 Posted: Sun Aug 2 19:01:26 1987 Date-Received: Sun, 2-Aug-87 22:41:51 EDT References: <1241@killer.UUCP> Reply-To: wvpj@vax1.UUCP (Marc Parmet) Organization: Cornell Computer Services, Ithaca NY Lines: 43 Keywords: c optimizing bugs compiler greenhills In article <1241@killer.UUCP> jfh@killer.UUCP (The Beach Bum) writes: >I am having trouble with a piece of code that works just fine with >10 or so other C compilers but causes core dumps when compiled with >Greenhills.... > >The piece of code implements sparse matrices with elements of varying >types. Pointers to the elements are stored in an array of arrays to >pointers to things and the types are handled in the same ugly manner. > I will briefly describe a problem I had with this Greenhill's C compiler using MPW on a Mac 2.0. Apple Tech Support verified this as a "genuine" bug. Assignments to static variables, or to variables declared outside any function, from a function result, may not work. The code I had trouble with is something like this: static extended n; extern extended sin(); void func() { n = sin(1.0); /* Fails */ } A fix was this: static extended n; extern extended sin(); void func() { extended temp; temp = sin(1.0); n = temp; } From you're brief description of the problem, it's hard to tell if this is the solution, but give it a shot... Marc Parmet Dept. of Mathematics Cornell University6