🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11506

Re: lattice C

#11506
From: Chuck McManis
Date: Sat, 18 Feb 1989 01:37
29 lines
1723 bytes
In article <9311@bloom-beacon.MIT.EDU> (Michael Zehr) writes:
>Has anyone experienced the following problem with lattice C? (5.02)
>variable = &foo.bar.arry[n];
>printf("%d %d\n", (int) variable, (int) &foo.bar.arry[n]);
>...yielding two different values!?!

It looks like a precedence problem, Lattice may incorrectly assign
"[]" and "&" the same precedence. Have you tried &(foo.bar.arry[n]) 
instead?

>does anyone know of cases in which lattice C screws up structure
>addresses and/or offsets?  is this why there's no option to see the 
>assembly code produced by the compiler? (1/2 :-) )

This is a completely bogus statement. A) Lattice has supplied OMD to
create assembly source from object modules since 3.1, B) with 5.0 you
could always pop cpr into "assembly" display mode and step through
the code.

>what do people recommend for a C compiler?  i need one that does a 
>fairly decent job of optimizing, but i'd also like it to be correct...

Was this with the -O switch that it screwed up? Or just on regular compiles.
If you really want control of your compiler port Gnu CC. 


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.
Technical Details
Message-ID: <90346@sun.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pepper!cmcmanis
References: <9311@bloom-beacon.MIT.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pepper!cmcmanis
From: cmcmanis%pepper@Sun.COM (Chuck McManis)
Newsgroups: comp.sys.amiga.tech
Subject: Re: lattice C
Message-ID: <90346@sun.uucp>
Date: 18 Feb 89 01:37:18 GMT
References: <9311@bloom-beacon.MIT.EDU>
Sender: news@sun.uucp
Reply-To: cmcmanis@sun.UUCP (Chuck McManis)
Organization: Sun Microsystems, Mountain View
Lines: 29