File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -987,6 +987,30 @@ if test "x" = "x$BOOST_PYTHON_LIB"; then
987987 DEPFOUND=false
988988fi
989989
990+ # Test for a "maybe uninitialized" in the python::boost library in
991+ # extract<std::string> when compiled with g++ 15.2.[01] and maybe others.
992+ # The test needs to have -O2 and -Wall enabled to expose the probem.
993+ AC_LANG_PUSH ( [ C++] )
994+ CPPFLAGS_SAVED="$CPPFLAGS"
995+ CPPFLAGS="$PYTHON_CPPFLAGS $BOOST_CPPFLAGS $CPPFLAGS -O2 -Wall -Werror"
996+ AC_CACHE_CHECK ( whether $CXX has a "maybe uninitialized" false positive , ax_cv_cxx_boost_maybe_uninit ,
997+ [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [
998+ #include <boost/python/extract.hpp>
999+ std::string func(boost::python::object& o) {
1000+ return boost::python::extract<std::string>(o);
1001+ }
1002+ int main() { return 0; }
1003+ ] ] ) ] ,
1004+ [ ax_cv_cxx_boost_maybe_uninit=no] ,
1005+ [ ax_cv_cxx_boost_maybe_uninit=yes] )
1006+ ]
1007+ )
1008+ CPPFLAGS="$CPPFLAGS_SAVED"
1009+ if test x$ax_cv_cxx_boost_maybe_uninit = xyes; then
1010+ CPPFLAGS="$CPPFLAGS -Wno-maybe-uninitialized"
1011+ fi
1012+ AC_LANG_POP ( [ C++] )
1013+
9901014AC_MSG_CHECKING ( [ whether to build documentation] )
9911015AC_ARG_ENABLE ( build-documentation ,
9921016 AS_HELP_STRING (
You can’t perform that action at this time.
0 commit comments