diff options
author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2023-08-07 13:51:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-07 13:51:29 +0100 |
commit | ddf46ca9e8c4c0bf3d1ab0aaa693eab34df8f35b (patch) | |
tree | 83080a21c58b945c2b3bfe645004cfc795c759ff | |
parent | aa23f345c3540f48d9c0380a0cd90e9d41bb131a (diff) | |
download | OpenCL-CTS-ddf46ca9e8c4c0bf3d1ab0aaa693eab34df8f35b.tar.gz |
math_brute_force: always initialize oldMode (#1796)
Avoid a maybe-uninitialized warning by ensuring that `oldMode` is
always initialized to 0. There is no need to use `memset` for this,
as `FPU_mode_type` is either an `int` or an `int64_t`.
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
-rw-r--r-- | test_conformance/math_brute_force/unary_two_results_float.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test_conformance/math_brute_force/unary_two_results_float.cpp b/test_conformance/math_brute_force/unary_two_results_float.cpp index 74c5a160..8d423408 100644 --- a/test_conformance/math_brute_force/unary_two_results_float.cpp +++ b/test_conformance/math_brute_force/unary_two_results_float.cpp @@ -189,12 +189,11 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) // Get that moving if ((error = clFlush(gQueue))) vlog("clFlush failed\n"); - FPU_mode_type oldMode; + FPU_mode_type oldMode = 0; RoundingMode oldRoundMode = kRoundToNearestEven; if (isFract) { // Calculate the correctly rounded reference result - memset(&oldMode, 0, sizeof(oldMode)); if (ftz || relaxedMode) ForceFTZ(&oldMode); // Set the rounding mode to match the device |