Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCC suggest-override warnings #303

Open
EugeneZelenko opened this issue Apr 13, 2020 · 7 comments
Open

GCC suggest-override warnings #303

EugeneZelenko opened this issue Apr 13, 2020 · 7 comments

Comments

@EugeneZelenko
Copy link

Complete list of warnings when Boost 1.72 is built with GCC 7.5 with -Wsuggest-override added to cxxflags:

./boost/python/object/py_function.hpp:102:22: warning: ‘unsigned int boost::python::objects::full_py_function_impl::max_arity() const [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector1]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:107:46: warning: ‘boost::python::detail::py_func_sig_info boost::python::objects::full_py_function_impl::signature() const [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector1]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:36:15: warning: ‘PyObject* boost::python::objects::caller_py_function_impl::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::caller >; PyObject = _object]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:41:22: warning: ‘unsigned int boost::python::objects::caller_py_function_impl::min_arity() const [with Caller = boost::python::detail::caller >]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:46:46: warning: ‘boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl::signature() const [with Caller = boost::python::detail::caller >]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:62:15: warning: ‘PyObject* boost::python::objects::signature_py_function_impl::operator()(PyObject*, PyObject*) [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector2<_object*, _object*>; PyObject = _object]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:67:22: warning: ‘unsigned int boost::python::objects::signature_py_function_impl::min_arity() const [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector2<_object*, _object*>]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:72:46: warning: ‘boost::python::detail::py_func_sig_info boost::python::objects::signature_py_function_impl::signature() const [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector2<_object*, _object*>]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:92:15: warning: ‘PyObject* boost::python::objects::full_py_function_impl::operator()(PyObject*, PyObject*) [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector1; PyObject = _object]’ can be marked override [-Wsuggest-override]
./boost/python/object/py_function.hpp:97:22: warning: ‘unsigned int boost::python::objects::full_py_function_impl::min_arity() const [with Caller = _object* (*)(_object*, _object*); Sig = boost::mpl::vector1]’ can be marked override [-Wsuggest-override]

Depends on boostorg/config#329.

@stefanseefeld
Copy link
Member

Not sure what to say. Boost.Python doesn't yet require C++11, so I'd suggest to simply not compile it with -Wsuggest-override for now.

@EugeneZelenko
Copy link
Author

Applications that use Boost.Python may be compiled with C++11 or newer. Also modern vwrsions of GCC and Clang set C++11/14 by default.

It's not very convenient to suppress warnings in each file that include Boost.Python.

@stefanseefeld
Copy link
Member

Can you suggest any alternative, short of making C++11 a requirement ?

@EugeneZelenko
Copy link
Author

Please take a look on boostorg/config#329 mentioned above. There will be macro that will handle both C++-11/newer and older versions.

@EugeneZelenko
Copy link
Author

BOOST_OVERRIDE was introduced in boostorg/config@ffe4e0f.

@EugeneZelenko
Copy link
Author

Patch is in python.txt.

@EugeneZelenko
Copy link
Author

Fixes are in #309.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants