On Thu, May 10, 2012 at 08:46:26AM -0700, Matthew Dempsky wrote:
> On Thu, Mar 15, 2012 at 3:19 AM, Marc Espie <es...@nerim.net> wrote:
> >  #define __glibcxx_max(T) \
> > -  (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0)
> > +  (__glibcxx_signed (T) ? \
> > +      (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
> > +
> 
> How about (T)(((unsigned T)1 << __glibc_digits(T)) - 1)?
> 
> Also, we should use (T)-1 << __glibc_digits(T) in __glibc_min to avoid
> relying on overflow behavior for signed types.

Look, landry just reminded me that I forgot to commit this. It was mostly
awaiting test results, and we've been running with this for almost two
months.

If you think something else is better, take it upstream, since I actually
took the fix from recent gcc, and I'd prefer to avoid diverging too much.

Reply via email to