tinycc-devel
[Top][All Lists]
Advanced

[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 23:49:28 +0100
User-agent: Mutt/1.4.2.1i

On Thu, Nov 20, 2008 at 07:42:59PM +0100, Masha Rabinovich wrote:
>  main ? 0 : 1, // function pointer is always true

Done.

>  (int)main + (int)1e9, // be sure the result is above 1.000.000.000

I removed the error message again. It was wrong in several ways.

There is no need for the expression to evaluate to a value > 1000000000.
(int)main may be negative.

Actually I'm not convinced that these two casts must be supported outside
of functions. Section 6.6 in C99 draft N869 does not talk about casting
address constants to integers. It does allow implemetations to accept
other constant expressions, though.

>  (int)main / 2, // here must be compile-time error, tcc can compile it
>  sin(1) ? 0 : 1, // here must be compile-time error, tcc can compile it

I don't think we should add checks for all variants of invalid code.
IMHO the main focus should be on correctly compiling valid code.
Otherwise we'll soon have a not so tiny TinyCC.

  Daniel




reply via email to

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