🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

lattice C

#11496
From: Michael Zehr
Date: Fri, 17 Feb 1989 20:13
23 lines
1331 bytes
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!?!

i've noticed it twice in programs, and so far, it appears that if n=0,
the assignment is correct, but the evaluation in printf is wrong, and
if n=1, it's the reverse.

both times, it's been the same root structure that has had problems.  
there's no redefinition of it, no strange macros, no compilation or
linking warnings.

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 :-) )

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...

-michael j zehr
Technical Details
Message-ID: <9311@bloom-beacon.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!tada

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!athena.mit.edu!tada
From: tada@athena.mit.edu (Michael Zehr)
Newsgroups: comp.sys.amiga.tech
Subject: lattice C
Summary: another bug?
Message-ID: <9311@bloom-beacon.MIT.EDU>
Date: 17 Feb 89 20:13:18 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Reply-To: tada@athena.mit.edu (Michael Zehr)
Organization: Massachusetts Institute of Technology
Lines: 23