libbladeRF: fix clang build

Without the change the build fails as
https://hydra.nixos.org/build/313370704:

    /private/tmp/nix-build-libbladeRF-2025.10.drv-0/source/host/utilities/bladeRF-cli/src/cmd/flash_image.c:71:35:
      error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare]
       71 |                 if (val[i] >= 'a' || val[i] <= 'f') {
          |                     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
This commit is contained in:
Sergei Trofimovich
2025-11-18 06:34:33 +00:00
parent 042d0c7f69
commit 6827e8d3e8
2 changed files with 17 additions and 0 deletions
@@ -0,0 +1,12 @@
Fix clang build: https://github.com/Nuand/bladeRF/pull/1045.patch
--- a/host/utilities/bladeRF-cli/src/cmd/flash_image.c
+++ b/host/utilities/bladeRF-cli/src/cmd/flash_image.c
@@ -68,7 +68,7 @@ static int handle_param(const char *param, char *val,
status = CLI_RET_INVPARAM;
} else {
for (i = 0; i < len && status == 0; i++) {
- if (val[i] >= 'a' || val[i] <= 'f') {
+ if (val[i] >= 'a' && val[i] <= 'f') {
val[i] -= 'a' - 'A';
} else if (!((val[i] >= '0' && val[i] <= '9') ||
(val[i] >= 'A' && val[i] <= 'F'))) {
+5
View File
@@ -26,6 +26,11 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [
# fix clang build: https://github.com/Nuand/bladeRF/pull/1045
./clang-fix.patch
];
nativeBuildInputs = [
cmake
pkg-config