Daniel Schepler dixit:

>void test_fn() {
>  int i;
>  for (i = 1; 0 < i; i *= 2)

Ah yes, the old GCC “Undefined Behaviour” issue.

As per a strict reading of the standard, this loop
never terminates because, for signed int, i*2>i is
tau. ☹

Adding -fwrapv to the compile command will fix this
(by making signed integer overflow Defined).

I don’t notice this on MirBSD because we *always* use
-fwrapv there…

bye,
//mirabilos
-- 
„nein: BerliOS und Sourceforge sind Plattformen für Projekte, github ist
eine Plattform für Einzelkämpfer“
        -- dieses Zitat ist ein Beweis dafür, daß auch ein blindes Huhn
           mal ein Korn findet, bzw. – in diesem Fall – Recht haben kann


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to