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