From 80357911fbb7ab1944720cc59bb57767f673731e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 17 Nov 2024 20:36:07 +1030 Subject: [PATCH] lightningd: fix clang 19 compile error. ``` 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 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 ``` Signed-off-by: Rusty Russell Changelog-Fixed: build: fix overzealous warning from clang 19. --- lightningd/subd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/subd.c b/lightningd/subd.c index 778811456..79534c373 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -944,7 +944,7 @@ char *opt_subd_dev_disconnect(const char *optarg, struct lightningd *ld) /* If test specified that this disconnection should cause permanent failure */ bool dev_disconnect_permanent(struct lightningd *ld) { - char permfail[strlen("PERMFAIL")]; + char permfail[sizeof("PERMFAIL") - 1]; int r; if (ld->dev_disconnect_fd == -1)