Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ set_target_properties(ALF
# Use C++17
target_compile_features(ALF PUBLIC cxx_std_17)

# GCC 15 emits a false-positive -Wmaybe-uninitialized when it deeply inlines
# Boost.Python's extract<std::string> rvalue converters (used in
# PythonInterface.cxx and the Swt/Ic Python interface headers) into
# std::pair/boost::variant construction. The warning points into libstdc++'s
# bits/basic_string.h (_M_string_length) but is triggered by ALF's converters;
# the code is correct. The aliBuild recipe compiles with -Werror, so this
# false positive would otherwise be a hard failure. Keep the warning visible
# but non-fatal. GCC-only: the flag is not understood by Clang/AppleClang, and
# the Python interface is only built on non-APPLE (Python3_FOUND) anyway.
target_compile_options(ALF PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wno-error=maybe-uninitialized>
)


####################################
# Executables
Expand Down
9 changes: 9 additions & 0 deletions src/IcPythonInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ struct IcArgsVariantConverter {

IcArgsVariant ret;

// GCC 15 emits a false-positive -Wmaybe-uninitialized when the std::string
// materialized from boost::python::extract<> is copied into the variant/pair.
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
bp::extract<std::string> s(obj);
if (s.check()) {
ret = s();
Expand All @@ -144,6 +150,9 @@ struct IcArgsVariantConverter {
ret = bp::extract<std::pair<std::string, uint32_t>>(tuple);
}
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

new (storage) IcArgsVariant(ret);
data->convertible = storage;
Expand Down
9 changes: 9 additions & 0 deletions src/PythonInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ struct pairConverter {
{
bp::tuple tuple(bp::borrowed(obj));
void* storage = ((bp::converter::rvalue_from_python_storage<std::pair<T1, T2>>*)data)->storage.bytes;
// GCC 15 emits a false-positive -Wmaybe-uninitialized when the std::string
// materialized from boost::python::extract<> is copied into the std::pair.
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
new (storage) std::pair<T1, T2>(bp::extract<T1>(tuple[0]), bp::extract<T2>(tuple[1]));
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
data->convertible = storage;
}
};
Expand Down
9 changes: 9 additions & 0 deletions src/ScaPythonInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ struct ScaArgsVariantConverter {

ScaArgsVariant ret;

// GCC 15 emits a false-positive -Wmaybe-uninitialized when the std::string
// materialized from boost::python::extract<> is copied into the variant/pair.
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
bp::extract<std::string> s(obj);
if (s.check()) {
ret = s();
Expand All @@ -150,6 +156,9 @@ struct ScaArgsVariantConverter {
ret = bp::extract<std::pair<std::string, uint32_t>>(tuple);
}
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

new (storage) ScaArgsVariant(ret);
data->convertible = storage;
Expand Down
9 changes: 9 additions & 0 deletions src/SwtPythonInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,22 @@ struct SwtArgsVariantConverter {

SwtArgsVariant ret;

// GCC 15 emits a false-positive -Wmaybe-uninitialized when the std::string
// materialized from boost::python::extract<> is copied into the variant/pair.
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
bp::extract<std::string> s(obj);
if (s.check()) {
ret = s();
} else {
bp::tuple tuple(bp::borrowed(obj));
ret = std::pair<std::string, uint32_t>(bp::extract<std::string>(tuple[0]), bp::extract<uint32_t>(tuple[1]));
}
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

new (storage) SwtArgsVariant(ret);
data->convertible = storage;
Expand Down