summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/std/limits
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-05 12:58:51 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-05 12:58:51 +0000
commit2efabe49937ae2492b0052009af5d07d44eee6a6 (patch)
treef4da6d6cd4e6a2187bc2b2a1b9659e75a82df0ae /libstdc++-v3/include/std/limits
parentc571c93f3f56aaf64d806be8aaa239e955171a3a (diff)
downloadppe42-gcc-2efabe49937ae2492b0052009af5d07d44eee6a6.tar.gz
ppe42-gcc-2efabe49937ae2492b0052009af5d07d44eee6a6.zip
2012-02-05 Jeffrey Yasskin <jyasskin@gcc.gnu.org>
Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/52119 * include/std/limits (__glibcxx_min): Fix to avoid undefined behavior. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183905 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/limits')
-rw-r--r--libstdc++-v3/include/std/limits4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits
index 67a5af4d804..ea37d9d20cd 100644
--- a/libstdc++-v3/include/std/limits
+++ b/libstdc++-v3/include/std/limits
@@ -1,7 +1,7 @@
// The template and inlines for the numeric_limits classes. -*- C++ -*-
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-// 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -129,7 +129,7 @@
#define __glibcxx_signed(T) ((T)(-1) < 0)
#define __glibcxx_min(T) \
- (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
+ (__glibcxx_signed (T) ? -__glibcxx_max (T) - 1 : (T)0)
#define __glibcxx_max(T) \
(__glibcxx_signed (T) ? \
OpenPOWER on IntegriCloud