Skip to content
Commit b4f8a7f7 authored by Tom Hughes's avatar Tom Hughes Committed by Benjamin Cabé
Browse files

tests: lib: cmsis_dsp: Fix -Wsometimes-uninitialized warning



Building libraries.cmsis_dsp.distance with clang warns:

tests/lib/cmsis_dsp/distance/src/f32.c:99:3: error: variable 'val' is
used uninitialized whenever switch default is taken
[-Werror,-Wsometimes-uninitialized]
                default:
                ^~~~~~~
tests/lib/cmsis_dsp/distance/src/f32.c:104:19: note: uninitialized use
occurs here
                output[index] = val;
                                ^~~
tests/lib/cmsis_dsp/distance/src/f32.c:57:16: note: initialize the
variable 'val' to silence this warning
                float32_t val;
                             ^
                              = 0.0

Not really necessary since there is a zassert_unreachable, but doesn't
hurt to initialize the variable.

Signed-off-by: default avatarTom Hughes <tomhughes@chromium.org>
parent 7c11db98
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment