This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR libstdc++/60936 reduce coupling between objects in libstdc++.a

On 03/02/17 19:02 +0000, Jonathan Wakely wrote:
Move explicit instantiation definitions for string I/O functions into
their own files so that iostream and locale definitions are not needed
for uses of strings without I/O. Move functions for throwing C++11
exceptions into the individual files defining the exception types, so
that using any of the functions from doesn't pull in
large pieces of the C++11 library. Finally, avoid using __int_to_char in to avoid pulling in for one function.

This fixes a bug in the __concat_size_t function, pointed out in the

Tested powerpc64le-linux, committed to trunk.

commit 3980cad61df5e51faff2f1edba151417838cc7ef
Author: redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Feb 16 12:06:28 2017 +0000

    PR libstdc++/60936 fix length calculation
    	PR libstdc++/60936
    	* src/c++11/ (__concat_size_t): Calculate length
    	written to buffer, not length remaining in buffer.
    git-svn-id: svn+ssh:// 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/libstdc++-v3/src/c++11/ b/libstdc++-v3/src/c++11/
index 1a408ca..de132d9 100644
--- a/libstdc++-v3/src/c++11/
+++ b/libstdc++-v3/src/c++11/
@@ -81,7 +81,7 @@ namespace __gnu_cxx {
 	__val /= 10;
     while (__val != 0);
-    size_t __len = __out - __cs;
+    size_t __len = __cs + __ilen - __out;
     if (__bufsize < __len)
       return -1;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]