[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Re: global 64-bit variables initialization
From: |
Daniel Glöckner |
Subject: |
Re: [Tinycc-devel] Re: global 64-bit variables initialization |
Date: |
Thu, 20 Nov 2008 12:36:22 +0100 |
User-agent: |
Mutt/1.4.2.1i |
On Thu, Nov 20, 2008 at 08:50:22AM +0100, Masha Rabinovich wrote:
> int a = 2.0 ? 0 : 1;
> int b = (_Bool)2.0;
> int c = !2.0;
> int d = 2.0;
> int e = (char)500;
>
> int main()
> {
> printf("%d %d %d %d %d\n", a, b, c, d, e);
> }
>
> GCC output: 0 1 0 2 -12
>
> TCC output: 1 0 1 0 500
Nice example. It triggers three bugs:
- constants are cast only inside functions
- '?' does not cast to bool
- '!' does not cast to bool
See http://repo.or.cz/w/tinycc/daniel.git
The fix for the first bug needs thorough testing before it is ready for
inclusion.
Daniel
- [Tinycc-devel] global 64-bit variables initialization, Masha Rabinovich, 2008/11/18
- [Tinycc-devel] Re: global 64-bit variables initialization, Masha Rabinovich, 2008/11/20
- Re: [Tinycc-devel] Re: global 64-bit variables initialization,
Daniel Glöckner <=
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Masha Rabinovich, 2008/11/20
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Masha Rabinovich, 2008/11/20
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Daniel Glöckner, 2008/11/20
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Masha Rabinovich, 2008/11/20
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Jerry, 2008/11/21
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Masha Rabinovich, 2008/11/21
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Jerry, 2008/11/22
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Masha Rabinovich, 2008/11/22
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, grischka, 2008/11/22
- Re: [Tinycc-devel] Re: global 64-bit variables initialization, Jerry, 2008/11/23