base64: fix for unsigned chars (e.g. ARM). ``` ccan/ccan/base64/base64.c:34:10: error: result of comparison of constant 255 with expression of type 'int8_t' (aka 'signed char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (ret == (char)0xff) { ~~~ ^ ~~~~~~~~~~ ccan/ccan/base64/base64.c:44:57: error: result of comparison of constant 255 with expression of type 'const signed char' is always true [-Werror,-Wtautological-constant-out-of-range-compare] return (maps->decode_map[(const unsigned char)b64char] != (char)0xff); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~ ``` Reported-by: Christian Decker Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
opt: allow show callbacks to return false. Sometimes, arguments are optional, so it's useful to decide at runtime whether to print a default in --help. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan: update show callback to take explicit length. For now we still use 80, but we could vary that in future. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan: allow user to set some bits in opt_table.type. In particular, Core Lightning wants to use this to flag arguments which can be specified multiple times (without overriding). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: remove undefined behavior. In particular, we were casting between struct prop_hdr ** and char **: fixing this properly was quite a rework. And in one case we were using a pre-realloc pointer in tests: though to be fair, we tested it for equality. But ubsan got upset anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tcon: fix warning when it's used with NULL on some gcc versions. Seems to be happening with gcc 12.2.0-3ubuntu1: ``` lightningd/jsonrpc.c: In function ‘destroy_json_command’: lightningd/jsonrpc.c:1180:63: error: the comparison will always evaluate as ‘false’ for the address of ‘canary’ will never be NULL [-Werror=address] lightningd/jsonrpc.c:108:53: note: ‘canary’ declared here ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
idtree: make sanitizer happier about shifts. ``` /home/rusty/devel/cvs/ccan/ccan/idtree/test/run-wrap.c:/home/rusty/devel/cvs/ccan/ccan/idtree/idtree.c:76:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>