From 3aae911c7025486869b8eeb2b45accc5da93219b Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Mon, 13 May 2024 16:53:02 -0400 Subject: [PATCH] Address "declared with greater visibility" warnings. Ensure that members of types that should be unhidden have unhidden forward declarations; likewise for their members, recursively. To that end, give CS_SERVERMSG_*'s underlying struct/union types explicit names (cs_servermsg_*). Signed-off-by: Aaron M. Ucko --- include/ctlib.h | 20 ++++++++++++++++---- include/freetds/tds.h | 17 +++++++++++++++++ include/freetds/utils/string.h | 4 ++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/include/ctlib.h b/include/ctlib.h index 1009b4e342..af3279255c 100644 --- a/include/ctlib.h +++ b/include/ctlib.h @@ -29,6 +29,18 @@ * Internal (not part of the exposed API) prototypes and such. */ +/* Forward declarations to fix "declared with greater visibility" warnings */ +struct _cs_dynamic; +struct _cs_param; +struct _csremote_proc; +struct cs_diag_msg; +struct cs_diag_msg_client; +struct cs_diag_msg_svr; +struct cs_servermsg_common1; +struct cs_servermsg_large; +struct cs_servermsg_small; +union cs_servermsg_internal; + #include #ifdef __cplusplus @@ -61,7 +73,7 @@ struct cs_diag_msg_client CS_CLIENTMSG clientmsg; }; -typedef struct { +typedef struct cs_servermsg_small { CS_MSGNUM msgnumber; CS_INT state; CS_INT severity; @@ -77,7 +89,7 @@ typedef struct { CS_INT sqlstatelen; } CS_SERVERMSG_SMALL; -typedef struct { +typedef struct cs_servermsg_large { CS_MSGNUM msgnumber; CS_INT state; CS_INT severity; @@ -93,7 +105,7 @@ typedef struct { CS_INT sqlstatelen; } CS_SERVERMSG_LARGE; -typedef struct { +typedef struct cs_servermsg_common1 { CS_MSGNUM msgnumber; CS_INT state; CS_INT severity; @@ -108,7 +120,7 @@ typedef struct { CS_INT sqlstatelen; } CS_SERVERMSG_COMMON2; -typedef union +typedef union cs_servermsg_internal { CS_SERVERMSG_SMALL small; CS_SERVERMSG_LARGE large; diff --git a/include/freetds/tds.h b/include/freetds/tds.h index deb6321e35..88dc983358 100644 --- a/include/freetds/tds.h +++ b/include/freetds/tds.h @@ -54,6 +54,23 @@ typedef struct tds_connection TDSCONNECTION; typedef struct tds_socket TDSSOCKET; typedef struct tds_column TDSCOLUMN; typedef struct tds_bcpinfo TDSBCPINFO; +/* More, to address "declared with greater visibility" warnings. */ +struct tds5_colinfo; +struct tds_authentication; +struct tds_bcpcoldata; +struct tds_capabilities; +struct tds_capability_type; +struct tds_column_funcs; +struct tds_context; +struct tds_cursor; +struct tds_cursor_status; +struct tds_dynamic; +struct tds_env; +struct tds_locale; +struct tds_login; +struct tds_packet; +struct tds_poll_wakeup; +struct tds_result_info; #include #include diff --git a/include/freetds/utils/string.h b/include/freetds/utils/string.h index c69cd7a0be..8a1dbb65c6 100644 --- a/include/freetds/utils/string.h +++ b/include/freetds/utils/string.h @@ -22,8 +22,6 @@ #include -#include - /** \addtogroup dstring * @{ */ @@ -38,6 +36,8 @@ typedef struct tds_dstr { char dstr_s[1]; } *DSTR; +#include + /** Internal representation for an empty string */ extern const struct tds_dstr tds_str_empty;