I have following stuff: boost-devel-1.34.1-alt1 gcc4.1-c++-4.1.2-alt2 When I compile simple code with -Wshadow flag I got many warnings: /usr/include/boost/spirit/core/scanner/scanner.hpp: In member function 'bool boost::spirit::scanner<IteratorT, PoliciesT>::at_end() const [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy>]': /usr/include/boost/spirit/core/scanner/scanner.hpp:233: instantiated from 'boost::spirit::scanner<IteratorT, PoliciesT>::scanner(IteratorT&, typename boost::call_traits<IteratorT>::param_type, const PoliciesT&) [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy>]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:106: instantiated from 'static boost::spirit::parse_info<IteratorT> boost::spirit::impl::phrase_parser<SkipT>::parse(const IteratorT&, const IteratorT&, const ParserT&, const SkipT&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:153: instantiated from 'boost::spirit::parse_info<IteratorT> boost::spirit::parse(const IteratorT&, const IteratorT&, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:171: instantiated from 'boost::spirit::parse_info<const CharT*> boost::spirit::parse(const CharT*, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with CharT = char, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' boost-test.cc:8: instantiated from here /usr/include/boost/spirit/core/scanner/scanner.hpp:245: warning: declaration of 'iteration_policy_t' shadows a member of 'this' /usr/include/boost/spirit/core/scanner/scanner.hpp: In member function 'typename boost::detail::iterator_traits<IteratorT>::value_type boost::spirit::scanner<IteratorT, PoliciesT>::operator*() const [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy>]': /usr/include/boost/spirit/core/primitives/primitives.hpp:53: instantiated from 'typename boost::spirit::parser_result<DerivedT, ScannerT>::type boost::spirit::char_parser<DrivedT>::parse(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, DerivedT = boost::spirit::chlit<char>]' /usr/include/boost/spirit/core/composite/sequence.hpp:54: instantiated from 'typename boost::spirit::parser_result<boost::spirit::sequence<A, B>, ScannerT>::type boost::spirit::sequence<A, B>::parse(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, A = boost::spirit::kleene_star<boost::spirit::blank_parser>, B = boost::spirit::chlit<char>]' /usr/include/boost/spirit/core/composite/sequence.hpp:53: instantiated from 'typename boost::spirit::parser_result<boost::spirit::sequence<A, B>, ScannerT>::type boost::spirit::sequence<A, B>::parse(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, A = boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, B = boost::spirit::kleene_star<boost::spirit::blank_parser>]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:107: instantiated from 'static boost::spirit::parse_info<IteratorT> boost::spirit::impl::phrase_parser<SkipT>::parse(const IteratorT&, const IteratorT&, const ParserT&, const SkipT&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:153: instantiated from 'boost::spirit::parse_info<IteratorT> boost::spirit::parse(const IteratorT&, const IteratorT&, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:171: instantiated from 'boost::spirit::parse_info<const CharT*> boost::spirit::parse(const CharT*, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with CharT = char, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' boost-test.cc:8: instantiated from here /usr/include/boost/spirit/core/scanner/scanner.hpp:252: warning: declaration of 'iteration_policy_t' shadows a member of 'this' /usr/include/boost/spirit/core/impl/match.ipp: In constructor 'boost::spirit::match<T>::match(size_t, typename boost::optional<T>::argument_type) [with T = char]': /usr/include/boost/spirit/core/scanner/scanner.hpp:86: instantiated from 'boost::spirit::match<T> boost::spirit::match_policy::create_match(size_t, const AttrT&, const IteratorT&, const IteratorT&) const [with AttrT = char, IteratorT = const char*]' /usr/include/boost/spirit/core/primitives/primitives.hpp:58: instantiated from 'typename boost::spirit::parser_result<DerivedT, ScannerT>::type boost::spirit::char_parser<DrivedT>::parse(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, DerivedT = boost::spirit::chlit<char>]' /usr/include/boost/spirit/core/composite/sequence.hpp:54: instantiated from 'typename boost::spirit::parser_result<boost::spirit::sequence<A, B>, ScannerT>::type boost::spirit::sequence<A, B>::parse(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, A = boost::spirit::kleene_star<boost::spirit::blank_parser>, B = boost::spirit::chlit<char>]' /usr/include/boost/spirit/core/composite/sequence.hpp:53: instantiated from 'typename boost::spirit::parser_result<boost::spirit::sequence<A, B>, ScannerT>::type boost::spirit::sequence<A, B>::parse(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, A = boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, B = boost::spirit::kleene_star<boost::spirit::blank_parser>]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:107: instantiated from 'static boost::spirit::parse_info<IteratorT> boost::spirit::impl::phrase_parser<SkipT>::parse(const IteratorT&, const IteratorT&, const ParserT&, const SkipT&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:153: instantiated from 'boost::spirit::parse_info<IteratorT> boost::spirit::parse(const IteratorT&, const IteratorT&, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:171: instantiated from 'boost::spirit::parse_info<const CharT*> boost::spirit::parse(const CharT*, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with CharT = char, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' boost-test.cc:8: instantiated from here /usr/include/boost/spirit/core/impl/match.ipp:24: warning: declaration of 'length' shadows a member of 'this' /usr/include/boost/spirit/core/scanner/scanner.hpp: In member function 'bool boost::spirit::scanner<IteratorT, PoliciesT>::at_end() const [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::no_skipper_iteration_policy<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy> >, boost::spirit::match_policy, boost::spirit::action_policy>]': /usr/include/boost/spirit/core/scanner/scanner.hpp:233: instantiated from 'boost::spirit::scanner<IteratorT, PoliciesT>::scanner(IteratorT&, typename boost::call_traits<IteratorT>::param_type, const PoliciesT&) [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::no_skipper_iteration_policy<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy> >, boost::spirit::match_policy, boost::spirit::action_policy>]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:36: instantiated from 'void boost::spirit::impl::skipper_skip(const ST&, const ScannerT&, const boost::spirit::skipper_iteration_policy<BaseT>&) [with ST = boost::spirit::nothing_parser, ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, BaseT = boost::spirit::iteration_policy]' /usr/include/boost/spirit/core/scanner/skipper.hpp:135: instantiated from 'void boost::spirit::skip_parser_iteration_policy<ParserT, BaseT>::skip(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, ParserT = boost::spirit::nothing_parser, BaseT = boost::spirit::iteration_policy]' /usr/include/boost/spirit/core/scanner/skipper.hpp:51: instantiated from 'bool boost::spirit::skipper_iteration_policy<BaseT>::at_end(const ScannerT&) const [with ScannerT = boost::spirit::scanner<const char*, boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy> >, BaseT = boost::spirit::iteration_policy]' /usr/include/boost/spirit/core/scanner/scanner.hpp:246: instantiated from 'bool boost::spirit::scanner<IteratorT, PoliciesT>::at_end() const [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy>]' /usr/include/boost/spirit/core/scanner/scanner.hpp:233: instantiated from 'boost::spirit::scanner<IteratorT, PoliciesT>::scanner(IteratorT&, typename boost::call_traits<IteratorT>::param_type, const PoliciesT&) [with IteratorT = const char*, PoliciesT = boost::spirit::scanner_policies<boost::spirit::skip_parser_iteration_policy<boost::spirit::nothing_parser, boost::spirit::iteration_policy>, boost::spirit::match_policy, boost::spirit::action_policy>]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:106: instantiated from 'static boost::spirit::parse_info<IteratorT> boost::spirit::impl::phrase_parser<SkipT>::parse(const IteratorT&, const IteratorT&, const ParserT&, const SkipT&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:153: instantiated from 'boost::spirit::parse_info<IteratorT> boost::spirit::parse(const IteratorT&, const IteratorT&, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with IteratorT = const char*, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' /usr/include/boost/spirit/core/scanner/impl/skipper.ipp:171: instantiated from 'boost::spirit::parse_info<const CharT*> boost::spirit::parse(const CharT*, const boost::spirit::parser<DerivedT>&, const boost::spirit::parser<SkipT>&) [with CharT = char, ParserT = boost::spirit::sequence<boost::spirit::sequence<boost::spirit::kleene_star<boost::spirit::blank_parser>, boost::spirit::chlit<char> >, boost::spirit::kleene_star<boost::spirit::blank_parser> >, SkipT = boost::spirit::nothing_parser]' boost-test.cc:8: instantiated from here /usr/include/boost/spirit/core/scanner/scanner.hpp:245: warning: declaration of 'iteration_policy_t' shadows a member of 'this' Code with trivial example will me attached.
Created attachment 2637 [details] Example of code.
P.S. May be it was fixed in boost-1.35 version, I don't known because doesn't have it for testing... :-(
Слава, поговори пожалуйста на эту тему с апстримом, я не настолько силен в С++, и уж тем более не силен в том надругательстве над С++, которое постоянно делают авторы boost.
Я так и думал, поэтому и написал на английском, чтобы потом можно было сослаться на баг :) Я просто думаю, вдруг это в 1.35 исправлено? Я что-то не смог найти у них в системне контроя версий возможность посмотреть какие изменения производились с файлом и когда. Ладно. Напишу им в рассылку, пожалуй..
php-coder: как напишешь в рассылку, прицепи сюда линк, плз. чисто поржать.
Created attachment 2638 [details] Патч, устраняющий эту проблему.
(In reply to comment #5) > php-coder: как напишешь в рассылку, прицепи сюда линк, плз. чисто поржать. http://www.nabble.com/boost%3A%3Aspirit-example-program-produce-many-warnings-when-compiled-with--Wshadow-option-to17324157.html Можешь ржать: патч "Applied in Boost SVN trunk."
Created attachment 2992 [details] Патч для boost 1.36.0 Странно, похоже, что в буст не полностью патч приняли, потому что варнинги частично всё равно остались. Обновил патч.
Нашёл вот: http://svn.boost.org/trac/boost/ticket/2304 Приложеный туда патч исправляет ещё несколько подобных потенциальных проблем. Стоит на него посмотреть, а заодно и спросить у апстрима их мнение по этому поводу. 2 php-coder@ : спросите? а то я на spirit-general не подписан...
В сизифе уже лежит boost-1:1.36.0-alt3, где это исправлено. Багу можно закрывать.
Обновил boost до 1.36.0-alt3 из Cизифа, проверил, работает.
(In reply to comment #11) > Обновил boost до 1.36.0-alt3 из Cизифа, проверил, работает. Спасибо!!!