bug-gnulib
[Top][All Lists]
Advanced

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

Re: GCC optimizes integer overflow: bug or feature?


From: Andrew Haley
Subject: Re: GCC optimizes integer overflow: bug or feature?
Date: Tue, 19 Dec 2006 19:05:35 +0000

Denis Vlasenko writes:
 > 
 > I wrote this just a few days ago:
 > 
 >         do {
 >                 int32_t v1 = v << 1;
 >                 if (v < 0) v1 ^= mask;
 >                 v = v1;
 >                 printf("%10u: %08x\n", c++, v);
 >         } while (v != 1);
 > 
 > I would become rather sad if this will stop compiling correctly.

I can understand the objections to do with "dusty deck" code that
hasn't been looked at for aeons, but in the case of code that you
wrote so recently, given that you understand the issue, why not simply
use the standard idiom?

Andrew.




reply via email to

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