Compile error boost 1.35.0 on Solaris 10/x64 Studio 12

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 } Regards, Anders

On Mon, Mar 31, 2008 at 02:03:41PM +0200, Anders Moe wrote:
I'm getting the following error in boost 1.35.0 on Solaris 10 using Sun Studio 12 :
I have similar problems. If you read carefully, you will see that Sun Studio is not a supported compiler in release 1.35. Not that it's of any help, but.. :/

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.

AMDG John Maddock wrote:
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.
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:
* 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.
It's a problem with the standard library allocator. allocate returns a void* and is wrapped in allocator_interface is the standard library to get type safety. In Christ, Steven Watanabe
participants (4)
-
Anders Moe
-
John Maddock
-
Steven Watanabe
-
Zeljko Vrba