From downstream Debian bug https://bugs.debian.org/1068158 :
The `site_scons/extractdebbuild.py` script tries to ensure that buildflags provided by dpkg-buildflags are the same between C and C++, however while `-Werror=implicit-function-declaration` is provided to the C build, it will never be provided to C++ builds by default since C++ does not recognize this flag:
[...]
g++ -o debian/tmp3/posix/dudley/src/Assemble_integrate.os -c -Wno-stringop-truncation -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wno-uninitialized -Werror=implicit-function-declaration -fopenmp -O3 -std=c++11 -pedantic -Wall -fPIC -finline-functions -Wno-unknown-pragmas -Wno-sign-compare -Wno-system-headers -Wno-long-long -Wno-strict-aliasing -Wno-unused-function -Wno-stringop-truncation -Wno-deprecated-declarations --param=max-vartrack-size=100000000 -isystem /usr/include/python3.11 -isystem /usr/include/boost -fPIC -DSVN_VERSION=-2 -DHAVE_GETHOSTNAME -DHAVE_BYTESWAP_H -DESPYTHON3 -DESYS_HAVE_BOOST_NUMPY -DESYS_DEPRECATED_BOOST_ENDIAN -DESYS_MOVED_BOOST_ENDIAN -DNETCDF4 -DESYS_HAVE_NETCDF -DESYS_HAVE_UMFPACK -DESYS_HAVE_SILO -DESYS_HAVE_BOOST_IO -DESYS_HAVE_PASO -DESYS_HAVE_DUDLEY -DESYS_HAVE_FINLEY -DESYS_HAVE_RIPLEY -DESYS_HAVE_SPECKLEY -DESYS_HAVE_WEIPA -Idebian/stage3/include -I/usr/include -I/usr/include/suitesparse dudley/src/Assemble_integrate.cpp
cc1plus: warning: '-Werror=' argument '-Werror=implicit-function-declaration' is not valid for C++
[...]
Details are discussed in https://bugs.debian.org/1068158 .
Please reconsider your choice on enforcing the same buildflags between C/C++ build, or apply a workaround to filter out this specific Werror flag.