Float problen running i386 inary on amd64
Miguel Lopes Santos Ramos
miguel at anjos.strangled.net
Fri Nov 2 16:15:42 PDT 2007
> From: Pete French <petefrench at ticketswitch.com>
>
> Hi, I have a very simple program:
>
>
> int
> main(int argc, char *argv[])
> {
> if(atof("3.2") == atof("3.200"))
> puts("They are equal");
> else
> puts("They are NOT equal!");
> return 0;
> }
>
>
> This works as expected on both i386 and amd64. But if I take the compiled
> binary from the i386 system and run it on the amd64 system thenit says they
> are not equal! I thought this was a library problem, but it even happens if
> I compile to a static binary, which would preseumably mean the same code is
> running on both systems.
>
> I am using 6.3-PRERELEASE here
Unfortunately, I didn't have the luck of having it reproduced here.
Maybe because my i386 is on 7.0, different compiler (although the amd64 is
still on RELENG_6).
Since you've rulled out everything else by building a static binary,
did you try using the new C99 functions in fenv.h related to the
floating-point environment?
Miguel Ramos
Lisboa, Portugal
More information about the freebsd-stable
mailing list