Boost logo

Boost Users :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2008-03-16 12:44:27


Hello,

cp now <cppnow <at> gmail.com> writes:

>
> Hello.I have a multi_index container that stores (and owns) pointers.
> It has 4 indexes that order themselves on member functions.I get
> error-freeand warning-free compiles as long as optimization is turned
> off (-O0). I get the warning below at all levels of optimization
> (1 through 3).
[...]
>Compiling with G++ 4.1.1 with full optimizations and full warnings:
> g++-4.1.1 -I../eclipselibs/boost -O3 -Wall -c -fmessage-length=0
> test.cpp../eclipselibs/boost/boost/multi_index/ordered_index.hpp:
> In member function 'boost::multi_index::detail::ordered_index_node
> <typename SuperMeta::type::node_type>*
> boost::multi_index::detail::ordered_index<KeyFromValue, Compare,
> SuperMeta, TagList, Category>::insert_(...)[...]
> ../eclipselibs/boost/boost/multi_index/ordered_index.hpp:551:
> warning: 'inf$side' may be used uninitialized in this function
>

Thanks for reporting this problem. You might like to know that
this is already fixed in the trunk and in the upcoming Boost 1.35
version:

http://svn.boost.org/trac/boost/changeset/39922#file34
(look for "struct link_info")

While you wait for the upgrage, I suggest you patch your local
copy of Boost.MultiIndex in the same way as shown above, i.e.
providing link_info with an explicit default ctor:

struct link_info
{
  link_info():side(to_left){}

  ordered_index_side side;
  node_impl_pointer pos;
};

Hope this helps. Thank you for using Boost.MultiIndex,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net