RHEL 5 SWIG generates non-const-correct C++ code

Solution Verified - Updated -

Issue

Here are the errors we see when using the swig packaged with Red Hat Enterprise Linux (RHEL) 5.4:

$ ./broken_swig.sh
broken_swig_wrap.cxx: In function 'int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)':
broken_swig_wrap.cxx:2051: error: invalid conversion from 'const char*' to 'char*'
broken_swig_wrap.cxx: In function 'void SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*, swig_type_info**, swig_type_info**)':
broken_swig_wrap.cxx:3129: error: invalid conversion from 'const char*' to 'char*'

Environment

  • RHEL 5.4
  • Python 2.6 (upstream)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.