Bug 401964

Summary: Including boost python causes a compile error.
Product: [openSUSE] openSUSE 11.0 Reporter: Faiazn Qazi <faizanqazi>
Component: DevelopmentAssignee: Philipp Thomas <pth>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: dmueller, hvogel, lars.vogdt, matz, rguenther
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: openSUSE 11.0   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Faiazn Qazi 2008-06-20 02:46:57 UTC
Trying to compile a simple program such as:


#include <boost/python.hpp>

int main()
{
	return 0;
}



with   g++ test.cpp  -I/usr/include/python2.5 -lboost_python -lpython2.5

results in the following error:

In file included from /usr/include/boost/python/class.hpp:29,
                 from /usr/include/boost/python.hpp:18,
                 from test.cpp:1:
/usr/include/boost/python/detail/def_helper.hpp:192: error: declaration of ‘typename boost::python::detail::keyword_extract<boost::tuples::tuple<const T1&, const T2&, const T3&, const T4&, boost::python::default_call_policies, boost::python::detail::keywords<0u>, const char*, void (boost::python::detail::not_specified::*)(), boost::tuples::null_type, boost::tuples::null_type> >::result_type boost::python::detail::def_helper<T1, T2, T3, T4>::keywords() const’
/usr/include/boost/python/args_fwd.hpp:35: error: changes meaning of ‘keywords’ from ‘struct boost::python::detail::keywords<0u>’
Comment 1 Dirk Mueller 2008-06-20 15:48:27 UTC
two conflicting declarations:

      typename keyword_extract<all_t>::result_type keywords() const
      {
          return keyword_extract<all_t>::extract(m_all);
      }


and

  template <>
  struct keywords<0>
  {
      BOOST_STATIC_CONSTANT(std::size_t, size = 0);
      static keyword_range range() { return keyword_range(); }
  };

in the same namespace. this doesn't look correct to me. the testcase above seems to work for me by just removing the first one from the header, but this is really strange code, I don't understand what it intended to do.

Comment 2 Faiazn Qazi 2008-06-20 17:54:31 UTC
Found a ticket for boost http://svn.boost.org/trac/boost/ticket/1931 , there is a workaround -fpermissive allows it to compile.


A patch to fix it that is used in Fedora:
--- boost_1_34_1/boost/python/detail/def_helper.hpp	2004-09-16 03:00:28.000000000 +0200
+++ boost_1_34_1-pm/boost/python/detail/def_helper.hpp	2008-02-14 13:26:23.000000000 +0100
@@ -155,7 +155,7 @@ namespace detail
           , T3 const&
           , T4 const&
           , default_call_policies
-          , keywords<0>
+          , boost::python::detail::keywords<0>
           , char const*
           , void(not_specified::*)()   // A function pointer type which is never an
                                        // appropriate default implementation
Comment 4 Philipp Thomas 2008-06-23 11:10:27 UTC
Thanks for the patch. I'll try to get an update released.
Comment 8 Lars Vogdt 2008-06-25 13:58:48 UTC
Released
Comment 9 Philipp Thomas 2008-06-26 14:55:15 UTC
*** Bug 404126 has been marked as a duplicate of this bug. ***
Comment 10 Anja Stock 2008-06-30 11:53:15 UTC
released
Comment 14 Swamp Workflow Management 2021-04-28 22:16:30 UTC
SUSE-RU-2021:1414-1: An update that solves one vulnerability, contains two features and has 22 fixes is now available.

Category: recommended (important)
Bug References: 1006584,1038083,1076640,1082318,1175886,401964,439805,457699,461372,477603,479659,544958,621140,655747,714373,765443,951902,958150,994378,994381,994382,994383,996917
CVE References: CVE-2008-0171
JIRA References: ECO-3147,SLE-17304
Sources used:
SUSE Linux Enterprise Module for Legacy Software 15-SP2 (src):    boost-legacy-base-1.66.0-1.4.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.