From d50536f875b6cfaa0ee7d8c9b83206ea0c866b4a Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 24 Feb 2024 22:51:02 +0000 Subject: [PATCH] srsran: fix `gcc-13` build Without the change build fails on `master` as https://hydra.nixos.org/build/250334809: In file included from /build/source/srsue/hdr/phy/phy_metrics.h:26, from /build/source/srsue/hdr/phy/phy_common.h:25, from /build/source/srsue/src/phy/phy_common.cc:26: In member function 'std::array<_Tp, _Nm>::value_type& std::array<_Tp, _Nm>::operator[](size_type) [with _Tp = float; long unsigned int _Nm = 5]', inlined from 'void srsue::phy_common::reset_measurements(uint32_t)' at /build/source/srsue/src/phy/phy_common.cc:662:18, inlined from 'void srsue::phy_common::reset()' at /build/source/srsue/src/phy/phy_common.cc:918:21: /nix/store/qs1nwzbp2ml3cxzsxihn82hl0w73snr0-gcc-13.2.0/include/c++/13.2.0/array:203:24: error: array subscript 5 is above array bounds of 'std::__array_traits::_Type' {aka 'float [5]'} [-Werror=array-bounds=] 203 | return _M_elems[__n]; | ~~~~~~~~^ Blanket `-Werror` is prone to build failures on newer toolchains. Disable it via exposed `cmake` configure knob. --- pkgs/applications/radio/srsran/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/radio/srsran/default.nix b/pkgs/applications/radio/srsran/default.nix index a6745d2c406c..5d03f9bcfdfb 100644 --- a/pkgs/applications/radio/srsran/default.nix +++ b/pkgs/applications/radio/srsran/default.nix @@ -41,6 +41,8 @@ stdenv.mkDerivation rec { zeromq ]; + cmakeFlags = [ "-DENABLE_WERROR=OFF" ]; + meta = with lib; { homepage = "https://www.srslte.com/"; description = "Open-source 4G and 5G software radio suite.";