Opened 13 years ago

Closed 12 years ago

#3894 closed Patches (fixed)

Trivial patch to fix compilation with Sun CC in alt stringstream

Reported by: Vadim Zeitlin <vz-boost@…> Owned by: Samuel Krempp
Milestone: Boost 1.44.0 Component: format
Version: Boost 1.42.0 Severity: Problem
Keywords: suncc Cc:

Description

The following trivial patch fixes compilation of boost/format/alt_sstream_impl.hpp with Sun CC:

  • boost/format/alt_sstream_impl.hpp

    a b  
    249249                    add_size /= 2;
    250250                if(0 < add_size) {
    251251                    new_size += add_size;
    252                     newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
     252                    newptr = static_cast<Ch *>(alloc_.allocate(new_size, is_allocated_? oldptr : 0));
    253253                }
    254254
    255255                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!

Change History (4)

comment:1 by Steven Watanabe, 13 years ago

Boost only supports the stlport standard library with Sun CC. The default standard library is quite broken in many other ways as well.

comment:2 by Vadim Zeitlin <vz-boost@…>, 13 years ago

Well, yes, it's broken but if you can't avoid using it (because customers code links with it and not STLport (which, BTW, is broken in its own, different, ways)) this trivial change still allows you to compile the code and our code that uses this header does work (well, as far as unit tests show, anyhow). So while, as mentioned in #3893, I don't plan to work around all bugs in Sun^H^H^HOracle STL it would still be nice if some simple ones to work around could be fixed.

comment:3 by Steven Watanabe, 12 years ago

Fixed in [62825].

comment:4 by Marshall Clow, 12 years ago

Milestone: Boost 1.43.0Boost 1.44.0
Resolution: fixed
Status: newclosed

This fix was included in 1.44.0.

Closing.

Note: See TracTickets for help on using tickets.