GNU bug report logs - #7928
mktime test in configure: UB resulting in infinite loop

Previous Next

Package: coreutils;

Reported by: Rich Felker <dalias <at> aerifal.cx>

Date: Thu, 27 Jan 2011 06:44:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 7928 <at> debbugs.gnu.org (full text, mbox):

From: Rich Felker <dalias <at> aerifal.cx>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 7928 <at> debbugs.gnu.org, Rich Felker <dalias <at> aerifal.cx>, bug-gnulib <at> gnu.org,
	Eric Blake <eblake <at> redhat.com>
Subject: Re: bug#7928: mktime test in configure: UB resulting in infinite loop
Date: Thu, 27 Jan 2011 17:08:46 -0500
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




This bug report was last modified 14 years and 177 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.