[comp.sys.amiga] Lattice C v5.0 Bug, Is it fixed in 5.02?

suggs%loki.edsg@hac2arpa.hac.com (Brian Suggs) (02/18/89)

The following code produces an error when compiled with the
Lattice v5.0 compiler:

/********************************/
extern char array[];
void fails()
{
   array[123456] = 'x';
}
/********************************/

The error given is:
test.c 5 Error 25: modifiable lvalue required

      I have tried using the -b0 option as well as a number
of others with no change.  Through some experimenting I
found that if the index of the array is less than 32767 the
code compiles without errors.  Curiously, it must be strictly
less than 32767; 32767 won't work but 32766 will.

      I reported this to Lattice through their BBS (this was
back in December) and the response I got from them was:

Message #3915
  To BRIAN SUGGS                            12-19-88   (Private)
From CARLOTTA DECONCILIS (SYSOP)            Subject (R)BUG-REPORT
---------------------------------------------------------------------------
I don't think this is a bug.  What does ANSI have to say about it?  I
mean, is an lvalue required?  Try the compatibility option for Lattice C,
could be a new ANSI standard that V5.0 is ahering [sic] to.  I'm convinced it's
not a compiler problem, just a language issue.
...........................................................................

      I replied that I didn't think the problem had anything to do with ANSI
and asked if they could please look into it further.  I never got another
response from them and since the 5.02 patch was coming out I thought I'd
wait and see if it fixed the problem.

      So, the $0.64 question is: Does it work with the new improved v5.02??
Their bulletin listing the bug fixes (posted Feb. 10) didn't convince me that
it was fixed.  Could someone who has the new patches try to compile the code
above? (As I am still checking the mail every day for my copy of the update.)

--Brian (suggs%loki.edsg@hac2arpa.hac.com)

P.S. This is the only time I have tried to get any kind of support from
Lattice and although I am a satisfied customer of theirs for the most part,
I found that this instance of technical support left something to be desired.

disclaimer: The above ramblings are mine and not my employers.

cmcmanis%pepper@Sun.COM (Chuck McManis) (02/20/89)

In article <9035@louie.udel.EDU> (Brian Suggs) writes:
-> The following code produces an error when compiled with the
-> Lattice v5.0 compiler:
->
-> /********************************/
-> extern char array[];
-> void fails()
-> {
->   array[123456] = 'x';
-> }
-> /********************************/
->
-> The error given is:
-> test.c 5 Error 25: modifiable lvalue required
->
->      I have tried using the -b0 option as well as a number
-> of others with no change.  Through some experimenting I
-> found that if the index of the array is less than 32767 the
-> code compiles without errors.  Curiously, it must be strictly
-> less than 32767; 32767 won't work but 32766 will.

Are you using the "-w" option for 16bit ints? If so try 123456L rather
than just the value. There is (was?) a bug in that the compiler was 
trying to make *everything* an int even when some constants were 
implicitly a long. 


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