]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix build with clang v15.0.6 [-Wdeprecated-non-prototype] (#1246)
authorgkinkie@gmail.com <kinkie@squid-cache.org>
Wed, 25 Jan 2023 15:00:42 +0000 (15:00 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 27 Jan 2023 12:19:42 +0000 (12:19 +0000)
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
lib/snmplib/snmp_api.c

index 78e7bfaf2a8aa21e297002864c28cf5699991264..3d84a077364092cb58544dbb270b89979900f0d2 100644 (file)
@@ -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;
 
index 955c39c11266f76b4cef45768ee3f3d99eabb67f..cf41a5fcbab640ccf2913b800a16cde99a49614a 100644 (file)
  * 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;