]> git.ozlabs.org Git - ccan/commitdiff
io: clean up compiler warning.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 29 May 2024 05:31:03 +0000 (15:01 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 24 Jun 2024 02:46:26 +0000 (12:16 +0930)
```
/home/rusty/devel/cvs/ccan/ccan/io/test/run-08-read-after-hangup.c: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/io/io.h:62:58: warning: declaration of ‘conn’ shadows a previous local [-Wshadow=compatible-local]
   62 |                                          struct io_conn *conn),         \
      |                                          ~~~~~~~~~~~~~~~~^~~~
/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/typesafe_cb.h:35:46: note: in definition of macro ‘typesafe_cb_cast’
   35 |                                              oktype),                   \
      |                                              ^~~~~~
/home/rusty/devel/cvs/ccan/ccan/io/io.h:60:22: note: in expansion of macro ‘typesafe_cb_preargs’
   60 |                      typesafe_cb_preargs(struct io_plan *, void *,      \
      |                      ^~~~~~~~~~~~~~~~~~~
/home/rusty/devel/cvs/ccan/ccan/io/test/run-08-read-after-hangup.c:42:9: note: in expansion of macro ‘io_new_conn’
   42 |         io_new_conn(conn, fds[1], init_writer, conn);
      |         ^~~~~~~~~~~
/home/rusty/devel/cvs/ccan/ccan/io/test/run-08-read-after-hangup.c:36:25: note: shadowed declaration is here
   36 |         struct io_conn *conn;
      |                         ^~~~

```

ccan/io/io.h

index cc92be2c5497f19e387e085b2568cbbf7238e015..5d084828b96aa561bbdfd6fe814ea5461f9342cb 100644 (file)
@@ -59,7 +59,7 @@ struct io_conn;
        io_new_conn_((ctx), (fd),                                       \
                     typesafe_cb_preargs(struct io_plan *, void *,      \
                                         (init), (arg),                 \
-                                        struct io_conn *conn),         \
+                                        struct io_conn *),             \
                     (void *)(arg))
 
 struct io_conn *io_new_conn_(const tal_t *ctx, int fd,