Re: [Boost-bugs] [Boost C++ Libraries] #4127: warning break strict-aliasing rules

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4127: warning break strict-aliasing rules
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-18 18:32:16


#4127: warning break strict-aliasing rules
--------------------------------------+-------------------------------------
  Reporter: anonymous | Owner: pdimov
      Type: Bugs | Status: closed
 Milestone: Boost 1.43.0 | Component: smart_ptr
   Version: Boost Development Trunk | Severity: Problem
Resolution: fixed | Keywords: warning strict-aliasing
--------------------------------------+-------------------------------------

Comment (by anonymous):

 I have another occurrence of this warning. I noticed that with -O1 there
 is no warning. No warning also if I remove -Wstrict-aliasing=2.

 In file included from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/function/detail/maybe_include.hpp:23:0,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/function/function2.hpp:11,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signals/detail/named_slot_map.hpp:18,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signals/detail/signal_base.hpp:15,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signals/signal_template.hpp:23,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signals/signal0.hpp:24,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signal.hpp:19,
                  from /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signals.hpp:9,
                  from ../lib/engine/framework/services.h:47,
                  from ekiga.h:46,
                  from ekiga.cpp:41:
 /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/function/function_template.hpp: In static member
 function ‘static R
 boost::detail::function::function_obj_invoker2<FunctionObj, R, T0,
 T1>::invoke(boost::detail::function::function_buffer&, T0, T1) [with
 FunctionObj = boost::signals::detail::group_bridge_compare<std::less<int>,
 int>, R = bool, T0 = boost::signals::detail::stored_group, T1 =
 boost::signals::detail::stored_group]’:
 /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/function/function_template.hpp:907:60:
 instantiated from ‘void boost::function2<R, T1, T2>::assign_to(Functor)
 [with Functor =
 boost::signals::detail::group_bridge_compare<std::less<int>, int>, R =
 bool, T0 = boost::signals::detail::stored_group, T1 =
 boost::signals::detail::stored_group]’
 /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/function/function_template.hpp:722:7:
 instantiated from ‘boost::function2<R, T1, T2>::function2(Functor,
 typename
 boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
 int>::type) [with Functor =
 boost::signals::detail::group_bridge_compare<std::less<int>, int>, R =
 bool, T0 = boost::signals::detail::stored_group, T1 =
 boost::signals::detail::stored_group, typename
 boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
 int>::type = int]’
 /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/signals/signal_template.hpp:197:53: instantiated
 from ‘boost::signal1<R, T1, Combiner, Group, GroupCompare,
 SlotFunction>::signal1(const Combiner&, const GroupCompare&) [with R =
 void, T1 = boost::shared_ptr<Ekiga::Service>, Combiner =
 boost::last_value<void>, Group = int, GroupCompare = std::less<int>,
 SlotFunction = boost::function1<void, boost::shared_ptr<Ekiga::Service>
>]’
 ../lib/engine/framework/services.h:73:20: instantiated from here
 /home/ededu/softs/ekiga/windows-
 mingww64/include/boost/function/function_template.hpp:129:13: warning:
 dereferencing type-punned pointer will break strict-aliasing rules
 [-Wstrict-aliasing]

 and others. So it seems function_template.hpp needs the same workaround.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4127#comment:9>
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:10 UTC