Date: Tue, 25 Dec 2012 21:15:47 +1300 From: Andrew Turner <andrew@fubar.geek.nz> To: src-committers@freebsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r244673 - head/contrib/libstdc++/include/std Message-ID: <20121225211547.63d42295@fubar.geek.nz> In-Reply-To: <201212250737.qBP7bYeh011465@svn.freebsd.org> References: <201212250737.qBP7bYeh011465@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 25 Dec 2012 07:37:34 +0000 (UTC) Andrew Turner <andrew@FreeBSD.org> wrote: > Author: andrew > Date: Tue Dec 25 07:37:33 2012 > New Revision: 244673 > URL: http://svnweb.freebsd.org/changeset/base/244673 > > Log: > Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t. This should say: Fix the __glibcxx_min and __glibcxx_max macros for an unsigned wchar_t. The left shift's in the original version cause GCC to issue a warning: warning: left shift count >= width of type > > * The __glibcxx_max macro came from GCC svn r138078, the last GPLv2 > revision of this file. > * I wrote the updated __glibcxx_min macro. > > Modified: > head/contrib/libstdc++/include/std/std_limits.h > > Modified: head/contrib/libstdc++/include/std/std_limits.h > ============================================================================== > --- head/contrib/libstdc++/include/std/std_limits.h Tue Dec 25 > 07:29:25 2012 (r244672) +++ > head/contrib/libstdc++/include/std/std_limits.h Tue Dec 25 > 07:37:33 2012 (r244673) @@ -134,10 +134,11 @@ #define > __glibcxx_signed(T) ((T)(-1) < 0) > #define __glibcxx_min(T) \ > - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) > + (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << > 1) : (T)0) > #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) > > #define __glibcxx_digits(T) \ > (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121225211547.63d42295>