pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/43572?usp=email )

Change subject: core/stats_tcp: declare struct osmo_fd in header
......................................................................

core/stats_tcp: declare struct osmo_fd in header

include/osmocom/core/stats_tcp.h names struct osmo_fd in its prototypes
without declaring it and without including select.h. A translation unit
that includes stats_tcp.h on its own therefore gives the type function
prototype scope, and a later definition of one of those functions in the
same unit has a different, incompatible type. Clang reports -Wvisibility
and then rejects the definitions outright.

Every in-tree caller happens to include select.h first, which is why this
never showed up. It surfaced while writing a Darwin implementation of the
same functions, where stats_tcp.h is the only include.

Add the forward declaration to the header rather than requiring each
includer to get the order right. A forward declaration is enough: the
prototypes take a pointer. Nothing here is platform specific and there is
no runtime impact.

Change-Id: I2f31f45317e6a28f47470ba6a5e4a31e4704e831
---
M include/osmocom/core/stats_tcp.h
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve




diff --git a/include/osmocom/core/stats_tcp.h b/include/osmocom/core/stats_tcp.h
index 9bc7111..d7d7791 100644
--- a/include/osmocom/core/stats_tcp.h
+++ b/include/osmocom/core/stats_tcp.h
@@ -1,5 +1,7 @@
 #pragma once

+struct osmo_fd;
+
 #define TCP_STATS_DEFAULT_INTERVAL 0   /* secs */
 #define TCP_STATS_DEFAULT_BATCH_SIZE 5 /* sockets per interval */


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43572?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2f31f45317e6a28f47470ba6a5e4a31e4704e831
Gerrit-Change-Number: 43572
Gerrit-PatchSet: 3
Gerrit-Owner: [email protected] <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to