From ff17e0ba179fe06c9bd86795c709c1a513f1012b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= Date: Tue, 12 Jun 2018 11:20:42 +0300 Subject: [PATCH 1/2] Enable -Wextra Enables extra warnings with -Wextra by default and disables sign-compare and unused-parameter warnings. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 30ed62fb..63ef9a39 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ AM_CONDITIONAL([HAVE_AVX2], [test x"$flag_avx2" = x"true"]) AM_CONDITIONAL([HAVE_SSE4_1], [test x"$flag_sse4_1" = x"true"]) AM_CONDITIONAL([HAVE_SSE2], [test x"$flag_sse2" = x"true"]) -KVZ_CFLAGS="-Wall -Wtype-limits -Wvla -I$srcdir/src -I$srcdir/src/extras -ftree-vectorize -fvisibility=hidden" +KVZ_CFLAGS="-Wall -Wextra -Wvla -Wno-sign-compare -Wno-unused-parameter -I$srcdir/src -I$srcdir/src/extras -ftree-vectorize -fvisibility=hidden" CFLAGS="$KVZ_CFLAGS $CFLAGS" AC_SEARCH_LIBS([log], [m c], [], [exit 1]) From 0692375caa506c4ea204ffe458715de7d1fb1757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= Date: Tue, 12 Jun 2018 13:57:07 +0300 Subject: [PATCH 2/2] Fix clobbered warnings in tests Adds volatile to loop variables in kvazaar tests in order to fix clobbered warnings. --- tests/dct_tests.c | 2 +- tests/sad_tests.c | 2 +- tests/speed_tests.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/dct_tests.c b/tests/dct_tests.c index 0ce2cb5d..d27085dc 100644 --- a/tests/dct_tests.c +++ b/tests/dct_tests.c @@ -186,7 +186,7 @@ SUITE(dct_tests) // Loop through all strategies picking out the intra sad ones and run // select strategies though all tests - for (unsigned i = 0; i < strategies.count; ++i) { + for (volatile unsigned i = 0; i < strategies.count; ++i) { const strategy_t * strategy = &strategies.strategies[i]; // Select buffer width according to function name for dct function. diff --git a/tests/sad_tests.c b/tests/sad_tests.c index 031ece47..1ee2ab36 100644 --- a/tests/sad_tests.c +++ b/tests/sad_tests.c @@ -329,7 +329,7 @@ SUITE(sad_tests) setup_tests(); - for (unsigned i = 0; i < strategies.count; ++i) { + for (volatile unsigned i = 0; i < strategies.count; ++i) { if (strcmp(strategies.strategies[i].type, "reg_sad") != 0) { continue; } diff --git a/tests/speed_tests.c b/tests/speed_tests.c index 2a0d245c..e9b3d5ef 100644 --- a/tests/speed_tests.c +++ b/tests/speed_tests.c @@ -355,7 +355,7 @@ SUITE(speed_tests) // Loop through all strategies picking out the intra sad ones and run // selectec strategies though all tests - for (unsigned i = 0; i < strategies.count; ++i) { + for (volatile unsigned i = 0; i < strategies.count; ++i) { const strategy_t * strategy = &strategies.strategies[i]; // Select buffer width according to function name.