[Boost-bugs] [Boost C++ Libraries] #5284: gcc-4.4.3 compiler warnings with Interprocess+Intrusive

Subject: [Boost-bugs] [Boost C++ Libraries] #5284: gcc-4.4.3 compiler warnings with Interprocess+Intrusive
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-08 22:38:21


#5284: gcc-4.4.3 compiler warnings with Interprocess+Intrusive
-------------------------------------------+--------------------------------
 Reporter: Danny Mitzel <mitzel@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: intrusive
  Version: Boost 1.46.0 | Severity: Problem
 Keywords: |
-------------------------------------------+--------------------------------
 I've been using Boost Interprocess managed_shared_memory for
 a short time. My project was previously using a cross compiler
 environment based on gcc-4.4.0/glibc-2.3.6 but is moving to
 gcc-4.4.3/glibc-2.11.1. gcc-4.4.3 with -O2 is started generating
 compiler warnings in the Intrusive library when I attempt to
 execute the construct() method on managed_shared_memory object.
 -O0 and -O1 are still happy. I'm wondering if anyone else has
 seen similar, has suggestions on debug/fix, or does this appear
 to be compiler issue?

 Program snippet:
 #include "boost/interprocess/managed_shared_memory.hpp"
 #include <cstdlib> //std::system
 #include <cstddef>

 int main(int argc, char *argv[])
 {
   using namespace boost::interprocess;
   typedef std::pair<double, int> MyType;

   //Construct managed shared memory
   managed_shared_memory segment(create_only, "MySharedMemory", 65536);

   //Create an object of MyType initialized to {0.0, 0}
   MyType *instance = segment.construct<MyType>
       ("MyType instance") //name of the object
       (0.0, 0); //ctor first argument
   return 0;
 }

 Compiler output:
 gcc-4.4.3-glibc-2.11.1-grte/x86/bin/g++ -ld -MD -MP -g -O2 -Wall -Werror
   -fno-omit-frame-pointer -Wno-error -Wno-deprecated -fpic
   -I/home/mitzel/src/boost_1_46_0 -c -o test.o test.cc
 In file included from
 /home/mitzel/src/boost_1_46_0/boost/intrusive/rbtree_algorithms.hpp:58,
                  from
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/rbtree_node.hpp:20,
                  from
 /home/mitzel/src/boost_1_46_0/boost/intrusive/set_hook.hpp:20,
                  from
 /home/mitzel/src/boost_1_46_0/boost/intrusive/rbtree.hpp:25,
                  from
 /home/mitzel/src/boost_1_46_0/boost/intrusive/set.hpp:19,
                  from
 /home/mitzel/src/boost_1_46_0/boost/interprocess/mem_algo/rbtree_best_fit.hpp:47,
                  from
 /home/mitzel/src/boost_1_46_0/boost/interprocess/detail/managed_memory_impl.hpp:22,
                  from
 /home/mitzel/src/boost_1_46_0/boost/interprocess/managed_shared_memory.hpp:21,
                  from test.cc:1:
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/tree_algorithms.hpp:
   In static member function 'static typename NodeTraits::node_ptr
   boost::intrusive::detail::tree_algorithms<NodeTraits>::minimum(typename
 NodeTraits::node_ptr)
   [with NodeTraits =
 boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void>,
 true>]':
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/tree_algorithms.hpp:490:
   warning: '<anonymous>' may be used uninitialized in this function
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/tree_algorithms.hpp:
   In static member function 'static typename
   NodeTraits::node_ptr
 boost::intrusive::detail::tree_algorithms<NodeTraits>::maximum(typename
 NodeTraits::node_ptr)
   [with NodeTraits =
 boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void>,
 true>]':
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/tree_algorithms.hpp:507:
   warning: '<anonymous>' may be used uninitialized in this function
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/utilities.hpp:
   In static member function 'static void
 boost::intrusive::detail::tree_algorithms<NodeTraits>::insert_equal_check_impl(
   bool, typename NodeTraits::node_ptr, typename NodeTraits::node_ptr,
 NodePtrCompare,
 boost::intrusive::detail::tree_algorithms<NodeTraits>::insert_commit_data&,
 size_t*)
   [with NodePtrCompare =
 boost::intrusive::detail::key_nodeptr_comp<std::less<
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>::block_ctrl>,
 boost::intrusive::rbtree_impl<boost::intrusive::setopt<boost::intrusive::detail::base_hook_traits<
 boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>::block_ctrl,
 boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void>,
 true>,
   (boost::intrusive::link_mode_type)0u, boost::intrusive::default_tag, 3>,
 std::less<boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>::block_ctrl>,
   long unsigned int, true> > >, NodeTraits =
 boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void>,
 true>]':
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/utilities.hpp:234:
 warning: '<anonymous>' may be used uninitialized in this function
 /home/mitzel/src/boost_1_46_0/boost/intrusive/detail/utilities.hpp:234:
 note: '<anonymous>' was declared here


 thanks for your time and any suggestions.
 danny <mitzel_at_[hidden]>

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5284>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC