lightning icon indicating copy to clipboard operation
lightning copied to clipboard

build: compilation failure with Clang 19

Open fanquake opened this issue 1 year ago • 2 comments

Issue and Steps to Reproduce

When testing Clang 19 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

fanquake avatar Sep 02 '24 14:09 fanquake

Thanks for reporting, will try to reproduce and patch it

vincenzopalazzo avatar Sep 02 '24 14:09 vincenzopalazzo

Updated the issue, now that Clang 19 is available: https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.0.

fanquake avatar Sep 17 '24 15:09 fanquake