Subject: [Boost-bugs] [Boost C++ Libraries] #3894: Trivial patch to fix compilation with Sun CC in alt stringstream
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-02-03 13:54:14
#3894: Trivial patch to fix compilation with Sun CC in alt stringstream
---------------------------------------------------+------------------------
Reporter: Vadim Zeitlin <vz-boost@â¦> | Owner: samuel_krempp
Type: Patches | Status: new
Milestone: Boost 1.43.0 | Component: format
Version: Boost 1.42.0 | Severity: Problem
Keywords: suncc |
---------------------------------------------------+------------------------
The following trivial patch fixes compilation of
`boost/format/alt_sstream_impl.hpp` with Sun CC:
{{{
#!diff
--- a/boost/format/alt_sstream_impl.hpp 2007-11-20
12:40:28.000000000 +0100
+++ b/boost/format/alt_sstream_impl.hpp 2010-02-02 22:16:16.000000000
+0100
@@ -249,7 +249,7 @@
add_size /= 2;
if(0 < add_size) {
new_size += add_size;
- newptr = alloc_.allocate(new_size, is_allocated_?
oldptr : 0);
+ newptr = static_cast<Ch *>(alloc_.allocate(new_size,
is_allocated_? oldptr : 0));
}
if(0 < prev_size)
}}}
I don't know why (as I don't know this code at all...) but `allocate()`
returns `void *` and not `char *` in this STL implementation so it fails
to compile without an explicit cast.
Maybe there is a better way to deal with this but I hope that if no other
solution is found, this patch could be applied to allow to use Boost with
Sun CC with its (old and broken...) standard library.
TIA!
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3894> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC