ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.81k stars 887 forks source link

build: compilation failure with Clang 19 (rc3) #7634

Open fanquake opened 1 week ago

fanquake commented 1 week ago

Issue and Steps to Reproduce

Clang 19 is likely to become available in the next week or two. When testing the latest Clang 19 (rc3) in some fuzzing infra, we noticed that lighting failed to compile (master at 5ec5580a587faf7b19f2d0b9dc445f6a42db2602):

# clang-19 --version
Ubuntu clang version 19.1.0 (++20240901083933+6d7e428df611-1~exp1~20240901084058.28)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin

./configure CC=clang-19
make -j17
<snip>
cc lightningd/offer.c
cc lightningd/signmessage.c
lightningd/subd.c:945:16: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
  945 |         char permfail[strlen("PERMFAIL")];
      |                       ^~~~~~~~~~~~~~~~~~
cc wallet/db.c
1 error generated.
make: *** [Makefile:301: lightningd/subd.o] Error 1
make: *** Waiting for unfinished jobs....
rm external/build-x86_64-pc-linux-gnu/libwally-core-build/src/secp256k1/libsecp256k1.la
vincenzopalazzo commented 1 week ago

Thanks for reporting, will try to reproduce and patch it