bug-gnulib
[Top][All Lists]
Advanced

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

Re: bug#7928: mktime test in configure: UB resulting in infinite loop


From: Rich Felker
Subject: Re: bug#7928: mktime test in configure: UB resulting in infinite loop
Date: Thu, 27 Jan 2011 17:08:46 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jan 27, 2011 at 07:42:10PM +0100, Bruno Haible wrote:
> Do you mean to say that GCC produces undefined behaviour for shifts of
> negative values, even those where the result is negative (no overflow)?
> I've never seen a sign of that.

I mean to say that left-shifting a negative value *at all* is
undefined behavior. I doubt gcc will ever break it, but why not use my
version of the code that's 100% safe and never invokes undefined
behavior?

Rich



reply via email to

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