From bc3cada6edbfb69639a1be0dafbf3dce21fec111 Mon Sep 17 00:00:00 2001 From: "gkinkie@gmail.com" Date: Wed, 25 Jan 2023 15:00:42 +0000 Subject: [PATCH] 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] --- lib/snmplib/mib.c | 23 +++++++---------------- lib/snmplib/snmp_api.c | 6 +----- 2 files changed, 8 insertions(+), 21 deletions(-) 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; -- 2.47.3