I tried compiling secp256k1 with clang and -Wconditional-uninitialized
and got the following warning:
0$ make check
1 CC src/tests-tests.o
2src/tests.c:4336:15: warning: variable 'recid' may be uninitialized when used here [-Wconditional-uninitialized]
3 CHECK(recid >= 0 && recid < 4);
4 ^~~~~
5./src/util.h:54:18: note: expanded from macro 'CHECK'
6 if (EXPECT(!(cond), 0)) { \
7 ^~~~
8./src/util.h:41:39: note: expanded from macro 'EXPECT'
9#define EXPECT(x,c) __builtin_expect((x),(c))
10 ^
11src/tests.c:4327:14: note: initialize the variable 'recid' to silence this warning
12 int recid;
13 ^
14 = 0
151 warning generated.
16 CCLD tests
17make check-TESTS
This initializes recid
and adds the -Wconditional-uninitialized
flag when building with clang.