[comp.sys.amiga] Is this a Lattice C 5.05 compiler bug ?

ZHHU@MTUS5.BITNET (11/09/90)

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

bruce@zuhause.MN.ORG (Bruce Albrecht) (11/10/90)

>In article <90312.111715ZHHU@MTUS5.BITNET> ZHHU@MTUS5.BITNET writes:
>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
[Code and commentary deleted.]
It worked fine on my 3000 running SAS C 5.10 on AmigaDOS 2.02
>
>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
>
This also worked fine.  Perhaps it's time to pay $40 for the upgrade.

--


bruce@zuhause.mn.org	   

farren@well.sf.ca.us (Mike Farren) (11/11/90)

ZHHU@MTUS5.BITNET writes:

>I am sorry, the correct compiler version is 5.04 not 5.05.

And this might be at the root of many of your problems.  The last
Lattice version was 5.05, in which many bugs were fixed (including
the one with floating-points in CPR).  The current version, from
SAS, is 5.10.   Upgrade, and it'll work better...
-- 
Mike Farren 				     farren@well.sf.ca.us

forgeas@swinjm.UUCP (Jean-Michel Forgeas) (11/12/90)

In article <21610@well.sf.ca.us>, Mike Farren writes:

> [...].  The current version, from
> SAS, is 5.10.   Upgrade, and it'll work better...

Sorry but no. 5.05 was fine, 5.10 have big bugs.
--
                                     \___/
Jean-Michel Forgeas                   \-/
cbmvax!cbmehq!cbmfra!swinjm!forgeas    |    The Software Winery
                                      -^-
                           And, where is the universe ?

walker@unx.sas.com (Doug Walker) (11/30/90)

In article <21610@well.sf.ca.us> farren@well.sf.ca.us (Mike Farren) writes:
>ZHHU@MTUS5.BITNET writes:
>
>>I am sorry, the correct compiler version is 5.04 not 5.05.
>
>And this might be at the root of many of your problems.  The last
>Lattice version was 5.05, in which many bugs were fixed (including
>the one with floating-points in CPR).  The current version, from
>SAS, is 5.10.   Upgrade, and it'll work better...

He's right, honest :-)  5.05 is a free upgrade to registered 5.04
owners - rush right out and call in for it.  (919)677-8000x5042.

5.10 is not a free upgrade, but you get a lot for your $40 upgrade
fee.  Check out the reviews in AmigaWorld and Amazing Computing
recently.  5.10 has been an extremely stable and bug-free release,
and I'm sure you would be happy with it.


  *****
=*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
 *|. o.| ||                                          1200/2400/9600 Dual
  | o  |//     For all you do, this bug's for you!
  ====== 
usenet: ...mcnc!rti!sas!walker   plink: dwalker  bix: djwalker