Skip to content

Commit

Permalink
[NFC] conversions: reenable Wunused-but-set-variable (#1845)
Browse files Browse the repository at this point in the history
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 <sven.vanhaastregt@arm.com>
  • Loading branch information
svenvh authored Jan 9, 2024
1 parent 05ba82a commit 115bbb3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion test_conformance/conversions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 0 additions & 3 deletions test_conformance/conversions/fplib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,13 @@ 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
int mantShift = 40 - clz(data);
uint32_t mantissa;
if (mantShift >= 0){
uint64_t temp = (uint64_t)data >> mantShift;
if (temp << mantShift != data)
inExact = 1;
mantissa = (uint32_t)temp;
}
else
Expand Down

0 comments on commit 115bbb3

Please sign in to comment.