Issue 110 in google-glog: strstream is deprecated

54 views
Skip to first unread message

codesite...@google.com

unread,
Jan 16, 2012, 11:24:27 AM1/16/12
to googl...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 110 by Van...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

With regard to deprecation, support of strstream could be removed from
future versions of compilers. Actually in my environment there isn't one.

Can we replace strstream with stringstream or make it an option? Maybe
through some HAVE_STRSTREAM flag? Is there any performance advantage of
using strstream?

codesite...@google.com

unread,
Jan 21, 2012, 8:50:35 PM1/21/12
to googl...@googlegroups.com

Comment #1 on issue 110 by joaod...@chromium.org: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

This makes linking fail on OSX using clang++ (3.0) with -std=c++0x and
-stdlib=libc++. The attached patch fixes the problem, which is that
strstream doesn't exist with these options.

Attachments:
glog-stringstream.patch 1.9 KB

codesite...@google.com

unread,
Jan 23, 2012, 5:50:44 AM1/23/12
to googl...@googlegroups.com

Comment #2 on issue 110 by Van...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

Can we also replace ostrstream with ostringstream ?

codesite...@google.com

unread,
Jan 23, 2012, 9:04:40 AM1/23/12
to googl...@googlegroups.com

Comment #3 on issue 110 by Van...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

Here is a patch that replaces strstream with stringstream and removes
inclusion of deprecated header.

Signed the "Individual Contributor License Agreement" form, so you can use
the code.

Attachments:
strstream_deprecated.patch 5.8 KB

codesite...@google.com

unread,
Jan 23, 2012, 9:38:55 AM1/23/12
to googl...@googlegroups.com

Comment #4 on issue 110 by Van...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

Oops, seems like ostringstream doesn't support specifying char buffer as a
backend. Sad :(

codesite...@google.com

unread,
Mar 15, 2012, 5:35:06 PM3/15/12
to googl...@googlegroups.com

Comment #5 on issue 110 by Van...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

I think I can implement a custom std::stringbuf as suggested here:
http://stackoverflow.com/questions/1494182/setting-the-internal-buffer-used-by-a-standard-stream-pubsetbuf

Or just copy output string using stringstream::str() function


codesite...@google.com

unread,
Oct 23, 2012, 6:12:21 PM10/23/12
to googl...@googlegroups.com

Comment #6 on issue 110 by gu...@nymgo.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

I have a multiplatform project using glog, and this deprecated support to
strstream happened to me while building the library to Android.

I'm attaching a patch for the SVN version (revision 115). Actually, it
solves two problems at once: removes the deprecated strstream usage (and
some old-style char pointer vectors), and includes the flag
HAVE_POSIX_FADVISE and ANDROID to the build, making the library compatible
with Android NDK (tested against android-ndk-r8).

This patch has been tested over Windows, Linux, Mac OSX, Android and iOS,
but using an alternative build system (CMake).

Attachments:
stringstream-android.patch 21.9 KB

codesite...@google.com

unread,
Jan 9, 2013, 11:13:33 AM1/9/13
to googl...@googlegroups.com
Updates:
Status: Accepted

Comment #7 on issue 110 by shinichi...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

Sorry for the latency...

Thanks for the patch! But, sorry, google's internal version of glog has
already fixed this issue, so I'd use the internal version to minimize diffs
between the opensource version and the internal version.

http://code.google.com/p/google-glog/source/detail?r=119

I cannot test the android part of your patch right now. If you kindly
update the patch for android, I'll apply it. Otherwise, I'll try to modify
your patch.

Anyway, we need to ask you to sign our Contributor License Agreement. If
you didn't yet, could you sign our Individual Contributor License
Agreement, please? It
seems that we need to ask you to sign this to avoid any troubles. The
process is just submitting an HTML form, and it shouldn't take your
time so much.

http://code.google.com/legal/individual-cla-v1.0.html

Please note that these forms do not transfer copyright: the
contributor retains her ownership in the work. The CLA just grants
Google a "perpetual, non-exclusive, royalty-free, etc..." right to use
the work, sublicense it, and so on.


codesite...@google.com

unread,
Jan 25, 2013, 1:28:16 AM1/25/13
to googl...@googlegroups.com
Updates:
Status: Fixed

Comment #8 on issue 110 by shinichi...@gmail.com: strstream is deprecated
http://code.google.com/p/google-glog/issues/detail?id=110

I fixed this using google's internal change.

http://code.google.com/p/google-glog/source/detail?r=119

Reply all
Reply to author
Forward
0 new messages