tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] initializer element is not constant for float compari


From: ian
Subject: Re: [Tinycc-devel] initializer element is not constant for float comparison
Date: Mon, 22 May 2023 08:40:57 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

Hi you all

IMHO, since static initialization must be done with litterals, the _expression_ (-1.0 <0) must be evaluated, hence should fail.
AFAIK it's even done (in that case) before main is called.
Seems to me like a preprocessing stuff.

--ian

Le 21/05/2023 à 23:27, Fred van Kempen via Tinycc-devel a écrit :
> When initializing static variables with the result of float comparisons, tcc errors out. This works fine on clang without warning, therefore I
> assume this is a bug. The _expression_ -1.0 < 0 should always evaluate to 1, no?

Since you are taking the result of a numeric _expression_, which is auto-casted to 'int' type, yes, this should work.

In my opinion, "tiz a bugg!" :)

--Fred


_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
--
İȃɲ ƝᵋᵃʳᶩỾ
-- MeNearly@gmail.com
-- Développeur compulsif

reply via email to

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