boostorg / boostorg/thread

Different vftable size for boost::detail::shared_state_base regarding BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION

Open
#337 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
214
Forks
171
PR merge metrics
No merged PRs in 30d

Description

**Version of Boost**: All of them, including 'master'

**File**: `thread/include/boost/thread/future.hpp `, around line 327

The matter is that this file contains the following portion of code (class boost::detail::shared_state_base):
```
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
virtual void set_continuation_ptr(continuation_ptr_type continuation, boost::unique_lock& lock)
{
continuations.push_back(continuation);
if (done) {
do_continuation(lock);
}
}
#endif
```
So the `vftable` layout depends on BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION macro, which leads to linker warning (and unpredictable runtime outcomes) when mixing code from two different modules, with only one of them using that macro.

There are some precautions about this issue before (see ll.285 and 304). It would be nice to have the same here.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.