Skip to content

Commit

Permalink
lightningd: fix clang 19 compile error.
Browse files Browse the repository at this point in the history
```
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
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: build: fix overzealous warning from clang 19.
  • Loading branch information
rustyrussell committed Nov 17, 2024
1 parent 2dd0d4c commit 8035791
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightningd/subd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8035791

Please sign in to comment.