Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Lattice C v5.0 Bug, Is it fixed in 5.02? Message-ID: <90454@sun.uucp> Date: 19 Feb 89 20:28:03 GMT References: <9035@louie.udel.EDU> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 30 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.