[PATCH 0/4] Fix build warnings and errors for 32-bit and musl
Stefano Brivio (4): treewide: Use 'z' length modifier for size_t/ssize_t conversions packet: Offset plus length is not always uint32_t, but it's always size_t tcp, tcp_splice: CONN_IDX subtraction of pointers isn't always long port_fwd, util: Include additional headers to fix build with musl netlink.c | 2 +- packet.c | 14 +++++++------- pcap.c | 4 ++-- port_fwd.c | 2 ++ tap.c | 12 ++++++------ tcp.c | 40 ++++++++++++++++++++++------------------ tcp_splice.c | 22 +++++++++++----------- util.h | 1 + 8 files changed, 52 insertions(+), 45 deletions(-) -- 2.39.2
Types size_t and ssize_t are not necessarily long, it depends on the
architecture.
Signed-off-by: Stefano Brivio
On Wed, Nov 29, 2023 at 02:46:07PM +0100, Stefano Brivio wrote:
Types size_t and ssize_t are not necessarily long, it depends on the architecture.
Most LGTM, but a couple of nits: [snip]
@@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) { if (func) { - trace("packet offset plus length %lu from size %lu, " + trace("packet offset plus length %lu from size %zu, "
The change here is certainly correct. But the remaining %lu is dubious. The value given is the sum of a uint32_t and two size_t, so it could depend on platform what exactly that will be promoted to. I think we should probably either cast the result explicitly to (size_t) and use %zu, or cast to (uint32_t) and use "%" PRIu32. [snip]
diff --git a/tcp_splice.c b/tcp_splice.c index a5c1332..8d08bb4 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -321,7 +321,7 @@ static int tcp_splice_connect_finish(const struct ctx *c,
if (fcntl(conn->pipe[side][0], F_SETPIPE_SZ, c->tcp.pipe_size)) { - trace("TCP (spliced): cannot set %d->%d pipe size to %lu", + trace("TCP (spliced): cannot set %d->%d pipe size to %zu", side, !side, c->tcp.pipe_size); } } @@ -554,7 +554,7 @@ retry: readlen = splice(conn->s[fromside], NULL, conn->pipe[fromside][1], NULL, c->tcp.pipe_size, SPLICE_F_MOVE | SPLICE_F_NONBLOCK); - trace("TCP (spliced): %li from read-side call", readlen); + trace("TCP (spliced): %zi from read-side call", readlen); if (readlen < 0) { if (errno == EINTR) goto retry; @@ -580,7 +580,7 @@ eintr: written = splice(conn->pipe[fromside][0], NULL, conn->s[!fromside], NULL, to_write, SPLICE_F_MOVE | more | SPLICE_F_NONBLOCK); - trace("TCP (spliced): %li from write-side call (passed %lu)", + trace("TCP (spliced): %zi from write-side call (passed %zu)", written, to_write);
'to_write' is actually an ssize_t which would suggest %zi. However looking at the code, I think to_write probably *should* be a size_t instead.
/* Most common case: skip updating counters. */ @@ -718,7 +718,7 @@ static void tcp_splice_pipe_refill(const struct ctx *c)
if (fcntl(splice_pipe_pool[i][0], F_SETPIPE_SZ, c->tcp.pipe_size)) { - trace("TCP (spliced): cannot set pool pipe size to %lu", + trace("TCP (spliced): cannot set pool pipe size to %zu", c->tcp.pipe_size); } }
-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On Thu, 30 Nov 2023 11:15:47 +1100
David Gibson
On Wed, Nov 29, 2023 at 02:46:07PM +0100, Stefano Brivio wrote:
Types size_t and ssize_t are not necessarily long, it depends on the architecture.
Most LGTM, but a couple of nits:
[snip]
@@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) { if (func) { - trace("packet offset plus length %lu from size %lu, " + trace("packet offset plus length %lu from size %zu, "
The change here is certainly correct. But the remaining %lu is dubious. The value given is the sum of a uint32_t and two size_t, so it could depend on platform what exactly that will be promoted to. I think we should probably either cast the result explicitly to (size_t) and use %zu, or cast to (uint32_t) and use "%" PRIu32.
[snip]
diff --git a/tcp_splice.c b/tcp_splice.c index a5c1332..8d08bb4 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -321,7 +321,7 @@ static int tcp_splice_connect_finish(const struct ctx *c,
if (fcntl(conn->pipe[side][0], F_SETPIPE_SZ, c->tcp.pipe_size)) { - trace("TCP (spliced): cannot set %d->%d pipe size to %lu", + trace("TCP (spliced): cannot set %d->%d pipe size to %zu", side, !side, c->tcp.pipe_size); } } @@ -554,7 +554,7 @@ retry: readlen = splice(conn->s[fromside], NULL, conn->pipe[fromside][1], NULL, c->tcp.pipe_size, SPLICE_F_MOVE | SPLICE_F_NONBLOCK); - trace("TCP (spliced): %li from read-side call", readlen); + trace("TCP (spliced): %zi from read-side call", readlen); if (readlen < 0) { if (errno == EINTR) goto retry; @@ -580,7 +580,7 @@ eintr: written = splice(conn->pipe[fromside][0], NULL, conn->s[!fromside], NULL, to_write, SPLICE_F_MOVE | more | SPLICE_F_NONBLOCK); - trace("TCP (spliced): %li from write-side call (passed %lu)", + trace("TCP (spliced): %zi from write-side call (passed %zu)", written, to_write);
'to_write' is actually an ssize_t which would suggest %zi. However looking at the code, I think to_write probably *should* be a size_t instead.
Oops, I didn't notice. Well, I know we're passing it to splice(), but we're also using it like this: if (!never_read && written < to_write) { to_write -= written; goto retry; } so I'd rather keep it as ssize_t for the moment (and re-spin this series with a %zi here), just in case we happen to do something silly with it and ssize_t is saving us. -- Stefano
On Thu, Nov 30, 2023 at 10:06:46AM +0100, Stefano Brivio wrote:
On Thu, 30 Nov 2023 11:15:47 +1100 David Gibson
wrote: On Wed, Nov 29, 2023 at 02:46:07PM +0100, Stefano Brivio wrote:
Types size_t and ssize_t are not necessarily long, it depends on the architecture.
Most LGTM, but a couple of nits:
[snip]
@@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) { if (func) { - trace("packet offset plus length %lu from size %lu, " + trace("packet offset plus length %lu from size %zu, "
The change here is certainly correct. But the remaining %lu is dubious. The value given is the sum of a uint32_t and two size_t, so it could depend on platform what exactly that will be promoted to. I think we should probably either cast the result explicitly to (size_t) and use %zu, or cast to (uint32_t) and use "%" PRIu32.
[snip]
diff --git a/tcp_splice.c b/tcp_splice.c index a5c1332..8d08bb4 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -321,7 +321,7 @@ static int tcp_splice_connect_finish(const struct ctx *c,
if (fcntl(conn->pipe[side][0], F_SETPIPE_SZ, c->tcp.pipe_size)) { - trace("TCP (spliced): cannot set %d->%d pipe size to %lu", + trace("TCP (spliced): cannot set %d->%d pipe size to %zu", side, !side, c->tcp.pipe_size); } } @@ -554,7 +554,7 @@ retry: readlen = splice(conn->s[fromside], NULL, conn->pipe[fromside][1], NULL, c->tcp.pipe_size, SPLICE_F_MOVE | SPLICE_F_NONBLOCK); - trace("TCP (spliced): %li from read-side call", readlen); + trace("TCP (spliced): %zi from read-side call", readlen); if (readlen < 0) { if (errno == EINTR) goto retry; @@ -580,7 +580,7 @@ eintr: written = splice(conn->pipe[fromside][0], NULL, conn->s[!fromside], NULL, to_write, SPLICE_F_MOVE | more | SPLICE_F_NONBLOCK); - trace("TCP (spliced): %li from write-side call (passed %lu)", + trace("TCP (spliced): %zi from write-side call (passed %zu)", written, to_write);
'to_write' is actually an ssize_t which would suggest %zi. However looking at the code, I think to_write probably *should* be a size_t instead.
Oops, I didn't notice. Well, I know we're passing it to splice(), but we're also using it like this:
if (!never_read && written < to_write) { to_write -= written; goto retry; }
so I'd rather keep it as ssize_t for the moment (and re-spin this series with a %zi here), just in case we happen to do something silly with it and ssize_t is saving us.
Eh.. that's the only place we subtract, and the literal line above verifies that the result will still be positive, so I think we're safe. But, whatever. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
According to gcc, PRIu32 matches the type of the argument we're
printing here on both 64 and 32-bits architectures. According to
Clang, though, that's not the case, as the result of the sum is an
unsigned long on 64-bit.
Use the z modifier, given that we're summing uint32_t to size_t, and
the result is at most promoted to size_t.
Signed-off-by: Stefano Brivio
On Wed, Nov 29, 2023 at 02:46:08PM +0100, Stefano Brivio wrote:
According to gcc, PRIu32 matches the type of the argument we're printing here on both 64 and 32-bits architectures. According to Clang, though, that's not the case, as the result of the sum is an unsigned long on 64-bit.
Use the z modifier, given that we're summing uint32_t to size_t, and the result is at most promoted to size_t.
Heh, sorry, obviously hadn't read this patch when I commented on this spot in the first one. The problem here is that the final promoted type depends on whether size_t is wider than uint32_t or not, which can vary with architecture. That said, I doubt we're likely to support anything with a size_t strictly *less* than 32-bits, so %zu is probably safe.
Signed-off-by: Stefano Brivio
--- packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packet.c b/packet.c index 12ac76b..ccfc846 100644 --- a/packet.c +++ b/packet.c @@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) { if (func) { - trace("packet offset plus length %lu from size %zu, " + trace("packet offset plus length %zu from size %zu, " "%s:%i", p->pkt[idx].offset + len + offset, p->buf_size, func, line); }
-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On Thu, 30 Nov 2023 11:18:48 +1100
David Gibson
On Wed, Nov 29, 2023 at 02:46:08PM +0100, Stefano Brivio wrote:
According to gcc, PRIu32 matches the type of the argument we're printing here on both 64 and 32-bits architectures. According to Clang, though, that's not the case, as the result of the sum is an unsigned long on 64-bit.
Use the z modifier, given that we're summing uint32_t to size_t, and the result is at most promoted to size_t.
Heh, sorry, obviously hadn't read this patch when I commented on this spot in the first one. The problem here is that the final promoted type depends on whether size_t is wider than uint32_t or not, which can vary with architecture.
That said, I doubt we're likely to support anything with a size_t strictly *less* than 32-bits, so %zu is probably safe.
Signed-off-by: Stefano Brivio
--- packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packet.c b/packet.c index 12ac76b..ccfc846 100644 --- a/packet.c +++ b/packet.c @@ -106,7 +106,7 @@ void *packet_get_do(const struct pool *p, size_t idx, size_t offset,
if (p->pkt[idx].offset + len + offset > p->buf_size) { if (func) { - trace("packet offset plus length %lu from size %zu, " + trace("packet offset plus length %zu from size %zu, " "%s:%i", p->pkt[idx].offset + len + offset, p->buf_size, func, line); }
On Thu, 30 Nov 2023 11:18:48 +1100
David Gibson
On Wed, Nov 29, 2023 at 02:46:08PM +0100, Stefano Brivio wrote:
According to gcc, PRIu32 matches the type of the argument we're printing here on both 64 and 32-bits architectures. According to Clang, though, that's not the case, as the result of the sum is an unsigned long on 64-bit.
Use the z modifier, given that we're summing uint32_t to size_t, and the result is at most promoted to size_t.
Heh, sorry, obviously hadn't read this patch when I commented on this spot in the first one. The problem here is that the final promoted type depends on whether size_t is wider than uint32_t or not, which can vary with architecture.
...I'm not sure if it's just a matter of warnings, but gcc is perfectly happy with PRIu32 for uint32_t + size_t on x86_64, so on top of the architecture, promotion rules also seem to vary between compilers. Or maybe it just doesn't complain about the possible format truncation.
That said, I doubt we're likely to support anything with a size_t strictly *less* than 32-bits, so %zu is probably safe.
Ah, yes, I took that for granted. Looking into older architectures where C would commonly be used, it looks like 16 bits of size_t would only suffice for *selected versions* of PDP-11 (PDP-11/15 and PDP-11/20, but not PDP-11/45 already, because the addressing space is larger than 64 KiB). Indeed there are 8 and 16 bits processors, but there doesn't appear to be any other modern architecture where 16 bits suffice for addressable memory (by design). -- Stefano
On Thu, Nov 30, 2023 at 10:07:00AM +0100, Stefano Brivio wrote:
On Thu, 30 Nov 2023 11:18:48 +1100 David Gibson
wrote: On Wed, Nov 29, 2023 at 02:46:08PM +0100, Stefano Brivio wrote:
According to gcc, PRIu32 matches the type of the argument we're printing here on both 64 and 32-bits architectures. According to Clang, though, that's not the case, as the result of the sum is an unsigned long on 64-bit.
Use the z modifier, given that we're summing uint32_t to size_t, and the result is at most promoted to size_t.
Heh, sorry, obviously hadn't read this patch when I commented on this spot in the first one. The problem here is that the final promoted type depends on whether size_t is wider than uint32_t or not, which can vary with architecture.
...I'm not sure if it's just a matter of warnings, but gcc is perfectly happy with PRIu32 for uint32_t + size_t on x86_64, so on top of the architecture, promotion rules also seem to vary between compilers. Or maybe it just doesn't complain about the possible format truncation.
Huh.. that's pretty surprising.
That said, I doubt we're likely to support anything with a size_t strictly *less* than 32-bits, so %zu is probably safe.
Ah, yes, I took that for granted. Looking into older architectures where C would commonly be used, it looks like 16 bits of size_t would only suffice for *selected versions* of PDP-11 (PDP-11/15 and PDP-11/20, but not PDP-11/45 already, because the addressing space is larger than 64 KiB).
Indeed there are 8 and 16 bits processors, but there doesn't appear to be any other modern architecture where 16 bits suffice for addressable memory (by design).
Right. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t
for this case, with a matching length modifier, 't'.
Signed-off-by: Stefano Brivio
On Wed, 29 Nov 2023 14:46:09 +0100
Stefano Brivio
On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t for this case, with a matching length modifier, 't'.
Signed-off-by: Stefano Brivio
--- tcp.c | 39 +++++++++++++++++++++------------------ tcp_splice.c | 14 +++++++------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/tcp.c b/tcp.c index 44468ca..c32c9cb 100644 --- a/tcp.c +++ b/tcp.c @@ -727,7 +727,7 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) it.it_value.tv_sec = ACT_TIMEOUT; }
- debug("TCP: index %li, timer expires in %lu.%03lus", CONN_IDX(conn), + debug("TCP: index %ti, timer expires in %lu.%03lus", CONN_IDX(conn),
[...]
Oops, I just realised this clashes with your "[PATCH v2 03/11] flow, tcp: Consolidate flow pointer<->index helpers". There, however, I guess that the new flow_idx() should return ptrdiff_t, which is signed. I can drop this patch if you re-spin it (assuming it makes sense to you), or I can adapt it on top of your patch -- whatever is most convenient for you. -- Stefano
On Wed, Nov 29, 2023 at 02:58:42PM +0100, Stefano Brivio wrote:
On Wed, 29 Nov 2023 14:46:09 +0100 Stefano Brivio
wrote: On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t for this case, with a matching length modifier, 't'.
Signed-off-by: Stefano Brivio
--- tcp.c | 39 +++++++++++++++++++++------------------ tcp_splice.c | 14 +++++++------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/tcp.c b/tcp.c index 44468ca..c32c9cb 100644 --- a/tcp.c +++ b/tcp.c @@ -727,7 +727,7 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) it.it_value.tv_sec = ACT_TIMEOUT; }
- debug("TCP: index %li, timer expires in %lu.%03lus", CONN_IDX(conn), + debug("TCP: index %ti, timer expires in %lu.%03lus", CONN_IDX(conn),
[...]
Oops, I just realised this clashes with your "[PATCH v2 03/11] flow, tcp: Consolidate flow pointer<->index helpers".
And then a bunch will be obsoleted by "flow, tcp: Add logging helpers for connection related messages".
There, however, I guess that the new flow_idx() should return ptrdiff_t, which is signed.
Actually, no, I don't think so. Yes the expression that generates it is naturally of type ptrdiff_t. But it's a bug to call flow_idx() on something not in the flow table, and places where we want to pass *in* a flow table index it makes more sense for it to be unsigned. So I think flow indices should be unsigned throughout.
I can drop this patch if you re-spin it (assuming it makes sense to you), or I can adapt it on top of your patch -- whatever is most convenient for you.
I have a couple of reasons to re-spin anyway. So how about you drop this, and I'll double check that I get the format specifiers sane after my series? -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
On Thu, 30 Nov 2023 11:27:21 +1100
David Gibson
On Wed, Nov 29, 2023 at 02:58:42PM +0100, Stefano Brivio wrote:
On Wed, 29 Nov 2023 14:46:09 +0100 Stefano Brivio
wrote: On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t for this case, with a matching length modifier, 't'.
Signed-off-by: Stefano Brivio
--- tcp.c | 39 +++++++++++++++++++++------------------ tcp_splice.c | 14 +++++++------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/tcp.c b/tcp.c index 44468ca..c32c9cb 100644 --- a/tcp.c +++ b/tcp.c @@ -727,7 +727,7 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) it.it_value.tv_sec = ACT_TIMEOUT; }
- debug("TCP: index %li, timer expires in %lu.%03lus", CONN_IDX(conn), + debug("TCP: index %ti, timer expires in %lu.%03lus", CONN_IDX(conn),
[...]
Oops, I just realised this clashes with your "[PATCH v2 03/11] flow, tcp: Consolidate flow pointer<->index helpers".
And then a bunch will be obsoleted by "flow, tcp: Add logging helpers for connection related messages".
There, however, I guess that the new flow_idx() should return ptrdiff_t, which is signed.
Actually, no, I don't think so. Yes the expression that generates it is naturally of type ptrdiff_t. But it's a bug to call flow_idx() on something not in the flow table, and places where we want to pass *in* a flow table index it makes more sense for it to be unsigned. So I think flow indices should be unsigned throughout.
I also think it should be unsigned (s/which is signed/which happens to be signed/ in my comment above). At the same time there's no such thing as an unsigned version of ptrdiff_t, so, given the other choices, I would still argue that we should use ptrdiff_t.
I can drop this patch if you re-spin it (assuming it makes sense to you), or I can adapt it on top of your patch -- whatever is most convenient for you.
I have a couple of reasons to re-spin anyway. So how about you drop this, and I'll double check that I get the format specifiers sane after my series?
Sure, dropping this. -- Stefano
On Thu, Nov 30, 2023 at 10:07:44AM +0100, Stefano Brivio wrote:
On Thu, 30 Nov 2023 11:27:21 +1100 David Gibson
wrote: On Wed, Nov 29, 2023 at 02:58:42PM +0100, Stefano Brivio wrote:
On Wed, 29 Nov 2023 14:46:09 +0100 Stefano Brivio
wrote: On 32-bit architectures, it's a regular int. C99 introduced ptrdiff_t for this case, with a matching length modifier, 't'.
Signed-off-by: Stefano Brivio
--- tcp.c | 39 +++++++++++++++++++++------------------ tcp_splice.c | 14 +++++++------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/tcp.c b/tcp.c index 44468ca..c32c9cb 100644 --- a/tcp.c +++ b/tcp.c @@ -727,7 +727,7 @@ static void tcp_timer_ctl(const struct ctx *c, struct tcp_tap_conn *conn) it.it_value.tv_sec = ACT_TIMEOUT; }
- debug("TCP: index %li, timer expires in %lu.%03lus", CONN_IDX(conn), + debug("TCP: index %ti, timer expires in %lu.%03lus", CONN_IDX(conn),
[...]
Oops, I just realised this clashes with your "[PATCH v2 03/11] flow, tcp: Consolidate flow pointer<->index helpers".
And then a bunch will be obsoleted by "flow, tcp: Add logging helpers for connection related messages".
There, however, I guess that the new flow_idx() should return ptrdiff_t, which is signed.
Actually, no, I don't think so. Yes the expression that generates it is naturally of type ptrdiff_t. But it's a bug to call flow_idx() on something not in the flow table, and places where we want to pass *in* a flow table index it makes more sense for it to be unsigned. So I think flow indices should be unsigned throughout.
I also think it should be unsigned (s/which is signed/which happens to be signed/ in my comment above). At the same time there's no such thing as an unsigned version of ptrdiff_t, so, given the other choices, I would still argue that we should use ptrdiff_t.
Again, I don't think so. ptrdiff_t is important because it allows for the difference of two *unconstrained* pointers. In our case the pointer is not unconstrained, and we want to return it as whatever type we typically use for an index into the connection table, which is an unsigned int.
I can drop this patch if you re-spin it (assuming it makes sense to you), or I can adapt it on top of your patch -- whatever is most convenient for you.
I have a couple of reasons to re-spin anyway. So how about you drop this, and I'll double check that I get the format specifiers sane after my series?
Sure, dropping this.
-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
lseek() is declared in unistd.h, and stdio.h provides sscanf().
Include these two headers in port_fwd.c.
SIGCHLD, even if used exclusively for clone(), is defined in
signal.h: add the include to util.h, as NS_CALL needs it.
Reported-by: lemmi
On Wed, Nov 29, 2023 at 02:46:10PM +0100, Stefano Brivio wrote:
lseek() is declared in unistd.h, and stdio.h provides sscanf(). Include these two headers in port_fwd.c.
SIGCHLD, even if used exclusively for clone(), is defined in signal.h: add the include to util.h, as NS_CALL needs it.
In theory the clang-tidy warnings I recently suppressed for ensuring we *directly* include the things we need would help avoid problems like this. Unfortunately it generates too many dumb warnings to be usable. I guess to do this correctly a checker would need to know the official/standardised header for every libc function, and require you to include that, whether or not that directly or directly contains it on this particular system.
Reported-by: lemmi
Link: https://github.com/void-linux/void-packages/actions/runs/6999782606/job/1903... Signed-off-by: Stefano Brivio
Reviewed-by: David Gibson
--- port_fwd.c | 2 ++ util.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/port_fwd.c b/port_fwd.c index 7943a30..6f6c836 100644 --- a/port_fwd.c +++ b/port_fwd.c @@ -17,6 +17,8 @@ #include
#include #include +#include +#include #include "util.h" #include "port_fwd.h" diff --git a/util.h b/util.h index 1f02588..86f1a7e 100644 --- a/util.h +++ b/util.h @@ -10,6 +10,7 @@ #include
#include #include +#include #include "log.h"
-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
participants (2)
-
David Gibson
-
Stefano Brivio