Repository navigation
More warning audit fallout - #136
Merged
Merged
Conversation
It could be NULL, and technically this is undefined (even though len arg will be 0).
Similar possibility in loop above, so fix that too.
```
ccan/ccan/cdump/cdump.c: In function ‘tok_take_conglom’:
ccan/ccan/cdump/cdump.c:272:35: error: ‘%.*s’ directive argument is null [-Werror=format-overflow=]
272 | "Line %u: '%.*s': %s\n",
| ^~~~
cc1: all warnings being treated as errors
make: *** [Makefile:1140: ccan-cdump.o] Error 1
make: *** Waiting for unfinished jobs....
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
```
In file included from ccan/ccan/strmap/strmap.h:5,
from ./common/memleak.h:4,
from lightningd/channel_gossip.c:5:
lightningd/channel_gossip.c: In function ‘broadcast_new_gossip’:
ccan/ccan/build_assert/build_assert.h:56:17: error: anonymous struct declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
56 | (sizeof(struct { _Static_assert(cond, "BUILD_ASSERT_OR_ZERO"); char c; }) - 1)
| ^~~~~~
ccan/ccan/typesafe_cb/typesafe_cb.h:35:46: note: in definition of macro ‘typesafe_cb_cast’
35 | oktype), \
| ^~~~~~
./lightningd/subd.h:184:19: note: in expansion of macro ‘typesafe_cb_preargs’
184 | typesafe_cb_preargs(void, void *, \
| ^~~~~~~~~~~~~~~~~~~
lightningd/channel_gossip.c:415:9: note: in expansion of macro ‘subd_req’
415 | subd_req(ld->gossip, ld->gossip,
| ^~~~~~~~
ccan/ccan/cast/cast.h:47:14: note: in expansion of macro ‘BUILD_ASSERT_OR_ZERO’
47 | (0 ? BUILD_ASSERT_OR_ZERO(cast_const_compat1((expr), type)) : \
| ^~~~~~~~~~~~~~~~~~~~
lightningd/channel_gossip.c:417:42: note: in expansion of macro ‘cast_const’
417 | -1, 0, addgossip_reply, cast_const(char *, desc));
| ^~~~~~~~~~
cc1: all warnings being treated as errors
```
Fortunately, union works (ccan/cast uses this, thanks Kimi!).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compiling CLN with recent CCAN revealed two more warnings at higher optimization, which this fixes.