From 115bbb3ca24b1b55a07d76a5b26dae295d149d7e Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Tue, 9 Jan 2024 18:47:04 +0100 Subject: [PATCH] [NFC] conversions: reenable Wunused-but-set-variable (#1845) Remove an assigned-to but unused variable. Reenable the Wunused-but-set-variable warning for the conversions suite, as it now compiles cleanly with this warning enabled. Signed-off-by: Sven van Haastregt --- test_conformance/conversions/CMakeLists.txt | 2 +- test_conformance/conversions/fplib.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/test_conformance/conversions/CMakeLists.txt b/test_conformance/conversions/CMakeLists.txt index 8ed3ba184c..11106439b1 100644 --- a/test_conformance/conversions/CMakeLists.txt +++ b/test_conformance/conversions/CMakeLists.txt @@ -16,6 +16,6 @@ set_source_files_properties( COMPILE_FLAGS -march=i686) endif(NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID) -set_gnulike_module_compile_flags("-Wno-unused-but-set-variable -Wno-sign-compare") +set_gnulike_module_compile_flags("-Wno-sign-compare") include(../CMakeCommon.txt) diff --git a/test_conformance/conversions/fplib.cpp b/test_conformance/conversions/fplib.cpp index 3b19b56df4..8e6caba7b0 100644 --- a/test_conformance/conversions/fplib.cpp +++ b/test_conformance/conversions/fplib.cpp @@ -198,7 +198,6 @@ float qcom_u64_2_f32(uint64_t data, bool sat, roundingMode rnd) return as_float(result); } case qcomRTN: { - int inExact = 0; if (!data) return 0.0f; uint32_t exponent = (127 + 64 - clz(data) - 1) << (FLT_MANT_DIG - 1); //add 1 for the implied 1.0 in normalized fp32 numbers @@ -206,8 +205,6 @@ float qcom_u64_2_f32(uint64_t data, bool sat, roundingMode rnd) uint32_t mantissa; if (mantShift >= 0){ uint64_t temp = (uint64_t)data >> mantShift; - if (temp << mantShift != data) - inExact = 1; mantissa = (uint32_t)temp; } else