Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1459 closed Bugs (fixed)

value_initialized leaves data uninitialized, when using Borland

Reported by: niels_dekker Owned by: niels_dekker
Milestone: Boost 1.35.0 Component: None
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:

Description

The data of an instance of boost::value_initialized<T> may not be initialized properly, when using Borland C++. This is caused by a Borland specific compiler issue: Value-initialization: POD struct should be zero-initialized

For example:

#include <boost/utility/value_init.hpp>

struct Data { int i; };

  ...

  boost::value_initialized<Data> d;
  BOOST_CHECK( get(d).i == 0 ); // Typically fails on Borland!

Fernando Cacciola and I have already discussed this issue. I hope to have a workaround within a few weeks... Note that the workaround described by Ticket #1217 does not yet work for Borland, because of some other Borland specific issues related to the use of "typename", placement-new, and explicit destructor calls.

Change History (4)

comment:1 by niels_dekker, 15 years ago

BTW, this particular Borland issue is also the cause of the current failures of value_init_test (version [40089]) at the regression test (for both siliconman and bcbboost).

comment:2 by niels_dekker, 15 years ago

A workaround is provided at the trunk, with changeset [41942]. See also the Boost developer mailing list, Re: [utility] value_init workaround fixed [Re: value_init_test failure].

comment:3 by niels_dekker, 15 years ago

Resolution: fixed
Status: newclosed

The workaround is merged from the trunk to the release branch, changeset [42501], so the issue should be resolved with the next release of Boost, version 1.35.0.

comment:4 by niels_dekker, 15 years ago

Milestone: To Be DeterminedBoost 1.35.0
Note: See TracTickets for help on using tickets.