]>
git.ozlabs.org Git - ccan/commit
tcon: fix warning from gcc when tcon_check_ptr arg is constant.
e.g. `&msg`:
```
src/nostrdb.c: In function ‘ndb_ingester_queue_event’:
ccan/ccan/tcon/tcon.h:150:24: error: the address of ‘msg’ will always evaluate as ‘true’ [-Werror=address]
150 | (sizeof((expr) ? (expr) : &(x)->_tcon[0].canary) ? (x) : (x))
| ^
ccan/ccan/tcon/tcon.h:116:30: note: in definition of macro ‘tcon_unwrap’
116 | #define tcon_unwrap(ptr) (&((ptr)->_base))
| ^~~
src/threadpool.h:91:42: note: in expansion of macro ‘tcon_check_ptr’
91 | threadpool_dispatch_(tcon_unwrap(tcon_check_ptr((tp), tp_canary, (msg))), (msg))
| ^~~~~~~~~~~~~~
src/nostrdb.c:4114:16: note: in expansion of macro ‘threadpool_dispatch’
4114 | return threadpool_dispatch(&ingester->tp, &msg);
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>