Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2008-03-31 12:38:51


Anders Moe wrote:
> Hi all
>
> I'm getting the following error in boost 1.35.0 on Solaris 10 using
> Sun Studio 12 :
>
> "/home/amoe/src/boost_1_35_0/boost/format/alt_sstream_impl.hpp", line
> 252: Error: Cannot assign void* to char*. Where: While
> instantiating "boost::io::basic_altstringbuf,
> std::allocator>::overflow(int)". Where: Instantiated from
> non-template code.1 Error(s) detected.
>
> I'd like to track down which part of my own code initiates the error,
> but frankly I'm not sure how to do that - the compiler output reports
> nothing but the above error.
>
> These are the relevant lines from alt_sstream_impl.hpp :
>
> add_size) {
> new_size += add_size;
> newptr = alloc_.allocate(new_size, is_allocated_?
> oldptr : 0); // ERROR
> }
>

The Boost code looks fine and legal to me: the
std::allocator<char>::allocate() should return a char* which would assign to
the variable just fine. Most of the tests for the iostreams lib are passing
with Sun-5.9 as well, so I'm guessing either:

* This is a compiler bug: the "Where: Instantiated from non-template code"
message looks suspicious to me - almost like this is a check on code that
isn't instantiated at all that's failing.
* Or it's a std lib issue with std::allocator - are you using Sunpro with
the optional STLport support? Sun's own std lib is rather old and non-std
compatible unfortunately.
* Or else the stream is being instantiated with an incompatible allocator
type - a user error in other words.

Sorry I can't be more helpful, but this should work with that compiler!

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net