Boost logo

Boost :

Subject: Re: [boost] [1.41.0] [spirit] [serialisation] Beta 1releasecandidate
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2009-11-04 19:06:51


> >> ./boost/spirit/home/classic/core/scanner/scanner.hpp:132: warning:
> >> dereferencing pointer 'val' does break strict-aliasing rules
> >>
> >> Again, this is normally a bug once optimizations are turned on.
> >
> > It's the first time I'm seeing this problem in Spirit. We need to
> > investigate this more closely as the warning comes from a template
> > function
> > (and 'val' is a template parameter), so I assume the issue is in the
> code
> > using Spirit. What file produces this diagnostic?
>
> It's from the serialization build:
>
> gcc.compile.c++
> /home/john/bin/boost/bin.v2/libs/serialization/build/gcc-
> 4.4.1/release/link-static/threading-multi/xml_wgrammar.o
> In file included from ./boost/archive/impl/basic_xml_grammar.hpp:59,
> from libs/serialization/src/xml_wgrammar.cpp:18:
> ./boost/spirit/core/non_terminal/rule.hpp:18:4: warning: #warning "This
> header is deprecated. Please use:
> boost/spirit/include/classic_rule.hpp"
> In file included from libs/serialization/src/basic_xml_grammar.ipp:20,
> from libs/serialization/src/xml_wgrammar.cpp:146:
> ./boost/spirit/core/composite/operators.hpp:18:4: warning: #warning
> "This
> header is deprecated. Please use:
> boost/spirit/include/classic_operators.hpp"
> In file included from libs/serialization/src/basic_xml_grammar.ipp:21,
> from libs/serialization/src/xml_wgrammar.cpp:146:
> ./boost/spirit/core/composite/actions.hpp:18:4: warning: #warning "This
> header is deprecated. Please use:
> boost/spirit/include/classic_actions.hpp"
> In file included from libs/serialization/src/basic_xml_grammar.ipp:22,
> from libs/serialization/src/xml_wgrammar.cpp:146:
> ./boost/spirit/core/primitives/numerics.hpp:18:4: warning: #warning
> "This
> header is deprecated. Please use:
> boost/spirit/include/classic_numerics.hpp"
> In file included from
> ./boost/spirit/home/classic/core/non_terminal/rule.hpp:33,
> from ./boost/spirit/include/classic_rule.hpp:11,
> from ./boost/spirit/core/non_terminal/rule.hpp:25,
> from ./boost/archive/impl/basic_xml_grammar.hpp:59,
> from libs/serialization/src/xml_wgrammar.cpp:18:
> ./boost/spirit/home/classic/core/scanner/scanner.hpp: In member
> function
> 'typename boost::spirit::match_result<ScannerT, AttrT>::type
> boost::spirit::impl::concrete_parser<ParserT, ScannerT,
> AttrT>::do_parse_virtual(const ScannerT&) const [with ParserT =
> boost::spirit::alternative<boost::spirit::alternative<boost::spirit::al
> ternative<boost::spirit::rule<boost::spirit::scanner<__gnu_cxx::__norma
> l_iterator<wchar_t*,
> std::basic_string<wchar_t, std::char_traits<wchar_t>,
> std::allocator<wchar_t> > >,
> boost::spirit::scanner_policies<boost::spirit::iteration_policy,
> boost::spirit::match_policy, boost::spirit::action_policy> >,
> boost::spirit::nil_t, boost::spirit::nil_t>,
> boost::spirit::rule<boost::spirit::scanner<__gnu_cxx::__normal_iterator
> <wchar_t*,
> std::basic_string<wchar_t, std::char_traits<wchar_t>,
> std::allocator<wchar_t> > >,
> boost::spirit::scanner_policies<boost::spirit::iteration_policy,
> boost::spirit::match_policy, boost::spirit::action_policy> >,
> boost::spirit::nil_t, boost::spirit::nil_t> >,
> boost::spirit::rule<boost::spirit::scanner<__gnu_cxx::__normal_iterator
> <wchar_t*,
> std::basic_string<wchar_t, std::char_traits<wchar_t>,
> std::allocator<wchar_t> > >,
> boost::spirit::scanner_policies<boost::spirit::iteration_policy,
> boost::spirit::match_policy, boost::spirit::action_policy> >,
> boost::spirit::nil_t, boost::spirit::nil_t> >,
> boost::spirit::action<boost::spirit::chset<wchar_t>,
> boost::archive::xml::append_char<std::basic_string<wchar_t,
> std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >, ScannerT =
> boost::spirit::scanner<__gnu_cxx::__normal_iterator<wchar_t*,
> std::basic_string<wchar_t, std::char_traits<wchar_t>,
> std::allocator<wchar_t> > >,
> boost::spirit::scanner_policies<boost::spirit::iteration_policy,
> boost::spirit::match_policy, boost::spirit::action_policy> >, AttrT =
> boost::spirit::nil_t]':
> ./boost/spirit/home/classic/core/scanner/scanner.hpp:132: warning:
> dereferencing pointer 'val' does break strict-aliasing rules
> ./boost/optional/optional.hpp:422: note: initialized from here

This one is caused by the code in optional.hpp (I'm seeing similar warnings
from optional in Wave, BTW), so it needs to be fixed there...

Regards Hartmut

-------------------
Meet me at BoostCon
http://boostcon.com


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