Article View: comp.sys.amiga.tech
Article #11650Re: lattice C
From: Mike (I'll think of something ye...
Date: Fri, 03 Mar 1989 00:19
Date: Fri, 03 Mar 1989 00:19
41 lines
2171 bytes
2171 bytes
In article <9311@bloom-beacon.MIT.EDU> tada@athena.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!?!
<
<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.
<
<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 :-) )
There's a known bug in 5 that causes offsets to be sign-extended.
This would cause the address to be mis-evaluated if it were more than
32K from the base of the structure.
I found this by checking the assembler ouptut via cpr (actually, it
took noticing that instructions changed between startup & execution,
and running with a watch break on them....)
<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...
From what I've seen, Lattice seems to have fewer bugs/release than
Manx. Neither is perfect, though both do better than many people you'd
wouldn't expect it of.
I've heard rumors of a port of gcc, with unhappy results (RMS likes
using stack space).
<mike
--
The Sword of Damocles is hanging over my head Mike Meyer
And I've got a feeling someone's gonna be cuttin' the thread mwm@berkeley.edu
Oh -- woe is me, My life is a misery ucbvax!mwm
And all I can see is I'm on the start of a pretty big downer mwm@ucbjade.BITNET
Technical Details
Message-ID:
<21088@agate.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwmReferences:
<9311@bloom-beacon.MIT.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) Newsgroups: comp.sys.amiga.tech Subject: Re: lattice C Message-ID: <21088@agate.BERKELEY.EDU> Date: 3 Mar 89 00:19:35 GMT References: <9311@bloom-beacon.MIT.EDU> Sender: usenet@agate.BERKELEY.EDU Organization: Missionaria Phonibalonica Lines: 41