Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure the ctx variable in function mbedtls_timing_self_test is initialized properly, to avoid build failures with -O3 e.g. on ppc64el cd /<<PKGBUILDDIR>>/obj-powerpc64le-linux-gnu/library && /usr/bin/cc -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/library -g -O3 -Werror=implicit-function-declaration -Werror=array-bounds -Werror=clobbered -Werror=volatile-register-var -D__DEB_CANARY_CFLAGS_428fca9bc1921c25c5121f9da7815cde__ -fno-omit-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/mbedtls-2.28.6-1 -D__DEB_CANARY_CPPFLAGS_428fca9bc1921c25c5121f9da7815cde__ -Wdate-time -D_FORTIFY_SOURCE=3 -Wall -Wextra -Wwrite-strings -Wformat=2 -Wno-format-nonliteral -Wvla -Wlogical-op -Wshadow -Wformat-signedness -Wformat-overflow=2 -Wformat-truncation -Werror -Wmissing-declarations -Wmissing-prototypes -MD -MT library/CMakeFiles/mbedcrypto_static.dir/xtea.c.o -MF CMakeFiles/mbedcrypto_static.dir/xtea.c.o.d -o CMakeFiles/mbedcrypto_static.dir/xtea.c.o -c /<<PKGBUILDDIR>>/library/xtea.c In function ‘mbedtls_timing_get_delay’, inlined from ‘mbedtls_timing_self_test’ at /<<PKGBUILDDIR>>/library/timing.c:427:13: /<<PKGBUILDDIR>>/library/timing.c:334:12: error: ‘ctx.fin_ms’ may be used uninitialized [-Werror=maybe-uninitialized] 334 | if (ctx->fin_ms == 0) { | ~~~^~~~~~~~ /<<PKGBUILDDIR>>/library/timing.c: In function ‘mbedtls_timing_self_test’: /<<PKGBUILDDIR>>/library/timing.c:402:34: note: ‘ctx’ declared here 402 | mbedtls_timing_delay_context ctx; | ^~~ In function ‘mbedtls_timing_get_delay’, inlined from ‘mbedtls_timing_self_test’ at /<<PKGBUILDDIR>>/library/timing.c:427:13: /<<PKGBUILDDIR>>/library/timing.c:344:26: error: ‘ctx.int_ms’ may be used uninitialized [-Werror=maybe-uninitialized] 344 | if (elapsed_ms >= ctx->int_ms) { | ~~~^~~~~~~~ /<<PKGBUILDDIR>>/library/timing.c: In function ‘mbedtls_timing_self_test’: /<<PKGBUILDDIR>>/library/timing.c:402:34: note: ‘ctx’ declared here 402 | mbedtls_timing_delay_context ctx; | ^~~ Signed-off-by: Gianfranco Costamagna <[email protected]> Signed-off-by: Gianfranco Costamagna <[email protected]>
- Loading branch information