Boost logo

Boost :

Subject: Re: [boost] [interprocess] Suspicious code in detail/segment_manager_helper.hpp
From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2008-12-18 04:53:04


Markus Schöpflin wrote:

> Hello,
>
> this file contains at line 384 the following method of index_data:
>
> void *value() const
> { return static_cast<void>(detail::get_pointer(m_ptr)); }
>
> Either the declaration of the return value or the cast seems to be wrong.

Attached patch fixes the problem and clears a number of test failures on
Tru64/CXX. OK to commit?

Markus

Index: interprocess/detail/segment_manager_helper.hpp
===================================================================
--- interprocess/detail/segment_manager_helper.hpp (revision 50312)
+++ interprocess/detail/segment_manager_helper.hpp (working copy)
@@ -382,7 +382,7 @@
    index_data(void *ptr) : m_ptr(ptr){}
 
    void *value() const
- { return static_cast<void>(detail::get_pointer(m_ptr)); }
+ { return static_cast<void *>(detail::get_pointer(m_ptr)); }
 };
 
 template<class MemoryAlgorithm>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk