tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Another ARM (RPi) compiler bug


From: Christian Jullien
Subject: Re: [Tinycc-devel] Another ARM (RPi) compiler bug
Date: Mon, 4 Feb 2013 07:46:08 +0100

I'm still looking in ISO standard if there is a note on this conversion.
Anyway, tcc behaves differently from gcc (and *all* other compiler I know
where is conversion truncates) while tcc rounds

#include <stdio.h>
int
main()
{
        {
        double d = 206.6;
        int i = (int)d;
        printf("%f %d\n", d, i);
        }
        {
        double d = -206.6;
        int i = (int)d;
        printf("%f %d\n", d, i);
        }
}

jullien ~/openlisp-10.0.0/src $ tcc -o foo foo.c && ./foo
206.600000 207
-206.600000 -207
jullien ~/openlisp-10.0.0/src $ gcc -o foo foo.c && ./foo
206.600000 206
-206.600000 -206

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Christian Jullien
Sent: lundi 4 février 2013 07:24
To: address@hidden
Subject: Re: [Tinycc-devel] Another ARM (RPi) compiler bug

Thx Daniel,
This one is fixed (was related to round function in my OpenLisp code) yet my
non-regression test shows now a bug in truncate (probably a similar bug).
I'm going to isolate this bug.

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Daniel Glöckner
Sent: dimanche 3 février 2013 23:52
To: address@hidden
Subject: Re: [Tinycc-devel] Another ARM (RPi) compiler bug

On Sun, Feb 03, 2013 at 10:14:16PM +0100, Christian Jullien wrote:
> Wrong double -> int conversion when double is < 0

Should be fixed as well now.
Same type of error. Must have had a bad day.

  Daniel

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]