On 01/27/2011 02:08 PM, Rich Felker wrote:
> 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?
Your version of the code provokes simil
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 a
> "JM" == Jim Meyering writes:
JM> I see no significant utility in accepting hex floats. Do you?
JM> If you're concerned about errors in conversion or the efficiency
JM> of the conversion process, then you probably don't want to use
JM> the sleep command in the first place.
the reason would
On Thu, Jan 27, 2011 at 11:42:25PM -0800, Paul Eggert wrote:
> On 01/27/2011 02:08 PM, Rich Felker wrote:
> > 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 i
On Fri, Jan 28, 2011 at 06:57:22PM +0100, Bruno Haible wrote:
> Rich Felker wrote:
> > Testing which of the three allowable signed integer
> > representations is used is easy: compare ~(t)1 against and -(t)1 and
> > -(t)2.
>
> Testing which of the three signed integer representations is in use
> i