compile
command_line: /opt/hostedtoolcache/cmake/4.0.3/x64/cmake-4.0.3-linux-x86_64/bin/cmake -E __run_co_compile --tidy=clang-tidy-18;--extra-arg-before=--driver-mode=gcc --source=/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c -- /usr/bin/clang-18 -DCOMB_BLOCKS=43 -DCOMB_TEETH=6 -DECMULT_WINDOW_SIZE=15 -DENABLE_MODULE_ECDH=1 -DENABLE_MODULE_ELLSWIFT=1 -DENABLE_MODULE_EXTRAKEYS=1 -DENABLE_MODULE_MUSIG=1 -DENABLE_MODULE_SCHNORRSIG=1 -DUSE_ASM_X86_64=1 -Dsecp256k1_EXPORTS -g -std=c90 -fPIC -Wall -pedantic -Wcast-align -Wconditional-uninitialized -Wextra -Wnested-externs -Wno-long-long -Wno-overlength-strings -Wno-unused-function -Wreserved-identifier -Wshadow -Wstrict-prototypes -Wundef -MD -MT src/CMakeFiles/secp256k1.dir/secp256k1.c.o -MF src/CMakeFiles/secp256k1.dir/secp256k1.c.o.d -o src/CMakeFiles/secp256k1.dir/secp256k1.c.o -c /home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c
working_directory: "/home/runner/work/nightly-builds/nightly-builds/build"
Target: secp256k1
Target Type: SHARED_LIBRARY
Source: /home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c
Language: C
Config: Debug
stderr:
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:902:48: warning: The left operand of '>>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
902 | r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:730:15: note: Assuming 'pubkey' is not equal to null
730 | ARG_CHECK(pubkey != NULL);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:46:18: note: expanded from macro 'ARG_CHECK'
46 | if (EXPECT(!(cond), 0)) { \
| ~~~~~~~~~^~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/util.h:136:39: note: expanded from macro 'EXPECT'
136 | #define EXPECT(x,c) __builtin_expect((x),(c))
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:730:5: note: Taking false branch
730 | ARG_CHECK(pubkey != NULL);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:46:5: note: expanded from macro 'ARG_CHECK'
46 | if (EXPECT(!(cond), 0)) { \
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:730:5: note: Loop condition is false. Exiting loop
730 | ARG_CHECK(pubkey != NULL);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:45:25: note: expanded from macro 'ARG_CHECK'
45 | #define ARG_CHECK(cond) do { \
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:731:15: note: Assuming 'tweak32' is not equal to null
731 | ARG_CHECK(tweak32 != NULL);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:46:18: note: expanded from macro 'ARG_CHECK'
46 | if (EXPECT(!(cond), 0)) { \
| ~~~~~~~~~^~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/util.h:136:39: note: expanded from macro 'EXPECT'
136 | #define EXPECT(x,c) __builtin_expect((x),(c))
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:731:5: note: Taking false branch
731 | ARG_CHECK(tweak32 != NULL);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:46:5: note: expanded from macro 'ARG_CHECK'
46 | if (EXPECT(!(cond), 0)) { \
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:731:5: note: Loop condition is false. Exiting loop
731 | ARG_CHECK(tweak32 != NULL);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:45:25: note: expanded from macro 'ARG_CHECK'
45 | #define ARG_CHECK(cond) do { \
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:734:12: note: 'overflow' is 0
734 | ret = !overflow && secp256k1_pubkey_load(ctx, &p, pubkey);
| ^~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:734:11: note: Left side of '&&' is true
734 | ret = !overflow && secp256k1_pubkey_load(ctx, &p, pubkey);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:736:9: note: 'ret' is 1
736 | if (ret) {
| ^~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:736:5: note: Taking true branch
736 | if (ret) {
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:737:13: note: Calling 'secp256k1_eckey_pubkey_tweak_mul'
737 | if (secp256k1_eckey_pubkey_tweak_mul(&p, &factor)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/eckey_impl.h:85:9: note: Assuming the condition is false
85 | if (secp256k1_scalar_is_zero(tweak)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/eckey_impl.h:85:5: note: Taking false branch
85 | if (secp256k1_scalar_is_zero(tweak)) {
| ^
/home/runner/work/nightly-builds/nightly-builds/src/eckey_impl.h:90:5: note: Calling 'secp256k1_ecmult'
90 | secp256k1_ecmult(&pt, &pt, tweak, &secp256k1_scalar_zero);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/ecmult_impl.h:358:5: note: Calling 'secp256k1_ecmult_strauss_wnaf'
358 | secp256k1_ecmult_strauss_wnaf(&state, r, 1, a, na, ng);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/ecmult_impl.h:252:5: note: Loop condition is true. Entering loop body
252 | for (np = 0; np < num; ++np) {
| ^
/home/runner/work/nightly-builds/nightly-builds/src/ecmult_impl.h:255:13: note: Assuming the condition is false
255 | if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/ecmult_impl.h:255:13: note: Left side of '||' is false
/home/runner/work/nightly-builds/nightly-builds/src/ecmult_impl.h:255:9: note: Taking false branch
255 | if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
| ^
/home/runner/work/nightly-builds/nightly-builds/src/ecmult_impl.h:259:9: note: Calling 'secp256k1_scalar_split_lambda'
259 | secp256k1_scalar_split_lambda(&na_1, &na_lam, &na[np]);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/scalar_impl.h:166:5: note: Calling 'secp256k1_scalar_mul_shift_var'
166 | secp256k1_scalar_mul_shift_var(&c1, k, &g1, 384);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:898:5: note: Calling 'secp256k1_scalar_mul_512'
898 | secp256k1_scalar_mul_512(l, a, b);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:812:5: note: Loop condition is false. Exiting loop
812 | SECP256K1_CHECKMEM_MSAN_DEFINE(l8, sizeof(*l8) * 8);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/checkmem.h:60:50: note: expanded from macro 'SECP256K1_CHECKMEM_MSAN_DEFINE'
60 | # define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
| ^
/home/runner/work/nightly-builds/nightly-builds/src/checkmem.h:42:41: note: expanded from macro 'SECP256K1_CHECKMEM_NOOP'
42 | #define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
| ^
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:898:5: note: Returning from 'secp256k1_scalar_mul_512'
898 | secp256k1_scalar_mul_512(l, a, b);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:902:15: note: 'shift' is < 512
902 | r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;
| ^~~~~
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:902:15: note: '?' condition is true
/home/runner/work/nightly-builds/nightly-builds/src/scalar_4x64_impl.h:902:48: note: The left operand of '>>' is a garbage value
902 | r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;
| ~~~~~~~~~~~~~~~~~ ^
/home/runner/work/nightly-builds/nightly-builds/src/util.h:163:17: warning: Call to 'malloc' has an allocation size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
163 | void *ret = malloc(size);
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:142:34: note: Calling 'secp256k1_context_preallocated_size'
142 | size_t const prealloc_size = secp256k1_context_preallocated_size(flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:97:16: note: Assuming the condition is true
97 | if (EXPECT((flags & SECP256K1_FLAGS_TYPE_MASK) != SECP256K1_FLAGS_TYPE_CONTEXT, 0)) {
| ^
/home/runner/work/nightly-builds/nightly-builds/src/util.h:136:39: note: expanded from macro 'EXPECT'
136 | #define EXPECT(x,c) __builtin_expect((x),(c))
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:97:5: note: Taking true branch
97 | if (EXPECT((flags & SECP256K1_FLAGS_TYPE_MASK) != SECP256K1_FLAGS_TYPE_CONTEXT, 0)) {
| ^
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:100:13: note: Returning zero
100 | return 0;
| ^~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:142:34: note: Returning from 'secp256k1_context_preallocated_size'
142 | size_t const prealloc_size = secp256k1_context_preallocated_size(flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:142:5: note: 'prealloc_size' initialized to 0
142 | size_t const prealloc_size = secp256k1_context_preallocated_size(flags);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:143:90: note: Passing the value 0 via 2nd parameter 'size'
143 | secp256k1_context* ctx = (secp256k1_context*)checked_malloc(&default_error_callback, prealloc_size);
| ^~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/secp256k1.c:143:50: note: Calling 'checked_malloc'
143 | secp256k1_context* ctx = (secp256k1_context*)checked_malloc(&default_error_callback, prealloc_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/nightly-builds/nightly-builds/src/util.h:163:17: note: Call to 'malloc' has an allocation size of 0 bytes
163 | void *ret = malloc(size);
| ^ ~~~~