Xref: utzoo comp.sys.amiga:71237 comp.sys.amiga.tech:15887 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!julius.cs.uiuc.edu!psuvax1!psuvm!cunyvm!ndsuvm1!mtus5!zhhu From: ZHHU@MTUS5.BITNET Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Is this a Lattice C 5.05 compiler bug ? Message-ID: <90312.111715ZHHU@MTUS5.BITNET> Date: 8 Nov 90 16:17:15 GMT Organization: Computing Technology Services, Michigan Technological Univ. Lines: 64 In article <90297.145845ZHHU@MTUS5.BITNET> I writes: >Whenever an unsigned integer multiply a float or a double, it will >crash my Amiga 1000, but the same source code works fine on a PC or It was compiled using the following command: LC -Lm program.c >UNIX machine. This is painful, because you can be careful by type >casting, but when you compile a PD program, especially the big files >you cannot afford the time to find them. I use Lattice C compiler 5.05, I am sorry, the correct compiler version is 5.04 not 5.05. >I wonder if this is a bug, whether 5.10 have the same problem. Can >any body kindly take the risk of crashing, and try the following: > >#include >main() >{ > unsigned int i; > int j; > float a; > i = 10; > j = 10; > a = j*15.0; /* should not crash here */ > printf("a= %f:n",a); > a = i*15.0; /* crash here on my machine*/ > printf("a= %f:n",a); >} This fact was confirmed by andrew@teslab.lab.oz.au (Andrew Phillips) he said: >I was sceptical but I tried it on my A1000 with Lattice 5.04 with the >same results. This is very surprising. I wonder if it is A1000 >specific? Frank Pecher (root@bcstarc.stgt.sub.org) said: >I own an Amiga 2000 and Lattice C5.05; the program works fine when >compiled with > > lc -f -Lm prog > If I compile with "lc -f -Lm ", It won't crash my Amiga 1000 either. I also tried the other possible switches, it turned out as follows: lc -flm -Lm crashes (math library lcm.lib) lc -fld -Lm crashes (math library lcm.lib) lc -fim -Lm no crashes (math library lcmieee.lib) lc -fid -Lm no crashes (math library lcmieee.lib) lc -ffs -Lf no crashes (math library lcmffp.lib) So I guess the problem is with the math library lcm.lib. There is problem woth the CodePRobe debuger too. Every time I use the command DISPLAY or WATCH to a floating point varible it will crash my machine. For example, it I have a variable x as float or double, if I say display x it crashes my machine, it always does. The program is compiled with lc -fim -Lm -d5 program.c Zhiquan