From: gkinkie@gmail.com Date: Wed, 25 Jan 2023 15:00:42 +0000 (+0000) Subject: Fix build with clang v15.0.6 [-Wdeprecated-non-prototype] (#1246) X-Git-Tag: SQUID_6_0_1~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43e0e506903f9a7049269b6c3a1a2818bc789ab1;p=thirdparty%2Fsquid.git Fix build with clang v15.0.6 [-Wdeprecated-non-prototype] (#1246) clang v15.0.6 distributed with Fedora Rawhide complains about function definitions using K&R style: lib/snmplib/mib.c:229:1: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype] --- diff --git a/lib/snmplib/mib.c b/lib/snmplib/mib.c index 78e7bfaf2a..3d84a07736 100644 --- a/lib/snmplib/mib.c +++ b/lib/snmplib/mib.c @@ -225,11 +225,9 @@ found: return (++*out_len); } +/// \param out_len number of subid's in "output" int -read_objid(input, output, out_len) -char *input; -oid *output; -int *out_len; /* number of subid's in "output" */ +read_objid(char *input, oid *output, int *out_len) { struct snmp_mib_tree *root = Mib; oid *op = output; @@ -260,10 +258,9 @@ int *out_len; /* number of subid's in "output" */ return (1); } +/// \param objidlen number of subidentifiers void -print_objid(objid, objidlen) -oid *objid; -int objidlen; /* number of subidentifiers */ +print_objid(oid *objid, int objidlen) { char buf[256]; struct snmp_mib_tree *subtree = Mib; @@ -274,11 +271,9 @@ int objidlen; /* number of subidentifiers */ } +/// \param objidlen number of subidentifiers void -sprint_objid(buf, objid, objidlen) -char *buf; -oid *objid; -int objidlen; /* number of subidentifiers */ +sprint_objid(char *buf, oid *objid, int objidlen) { struct snmp_mib_tree *subtree = Mib; @@ -287,11 +282,7 @@ int objidlen; /* number of subidentifiers */ } static struct snmp_mib_tree * -get_symbol(objid, objidlen, subtree, buf) -oid *objid; -int objidlen; -struct snmp_mib_tree *subtree; -char *buf; +get_symbol(oid *objid, int objidlen, struct snmp_mib_tree *subtree, char *buf) { struct snmp_mib_tree *return_tree = NULL; diff --git a/lib/snmplib/snmp_api.c b/lib/snmplib/snmp_api.c index 955c39c112..cf41a5fcba 100644 --- a/lib/snmplib/snmp_api.c +++ b/lib/snmplib/snmp_api.c @@ -103,11 +103,7 @@ * occurs, -1 is returned. If all goes well, 0 is returned. */ int -snmp_build(session, pdu, packet, out_length) -struct snmp_session *session; -struct snmp_pdu *pdu; -u_char *packet; -int *out_length; +snmp_build(struct snmp_session *session, struct snmp_pdu *pdu, u_char *packet, int *out_length) { u_char *bufp;