Unbreak i386 and other builds where size_t != unsigned long.
authorppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Sep 2013 15:29:14 +0000 (15:29 +0000)
committerppluzhnikov <ppluzhnikov@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Sep 2013 15:29:14 +0000 (15:29 +0000)
2013-09-23  Paul Pluzhnikov  <ppluzhnikov@google.com>

* src/c++11/snprintf_lite.cc (__concat_size_t): Use only
std::__int_to_char<unsigned long long>()

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202832 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/src/c++11/snprintf_lite.cc

index 069bd40..ab960e7 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-23  Paul Pluzhnikov  <ppluzhnikov@google.com>
+
+       * src/c++11/snprintf_lite.cc (__concat_size_t): Use only
+       std::__int_to_char<unsigned long long>()
+
 2013-09-21  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
        * include/bits/functexcept.h (__throw_out_of_range_fmt): New.
index 9509c42..02a8187 100644 (file)
@@ -70,9 +70,10 @@ namespace __gnu_cxx {
   int __concat_size_t(char *__buf, size_t __bufsize, size_t __val)
   {
     // Long enough for decimal representation.
-    int __ilen = 3 * sizeof(__val);
+    unsigned long long __val_ull = __val;
+    int __ilen = 3 * sizeof(__val_ull);
     char *__cs = static_cast<char*>(__builtin_alloca(__ilen));
-    size_t __len = std::__int_to_char(__cs + __ilen, __val,
+    size_t __len = std::__int_to_char(__cs + __ilen, __val_ull,
                                      std::__num_base::_S_atoms_out,
                                      std::ios_base::dec, true);
     if (__bufsize < __len)