Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4810 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23060 invoked by uid 1010); 13 Oct 2003 11:04:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23014 invoked from network); 13 Oct 2003 11:04:30 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by pb1.pair.com with SMTP; 13 Oct 2003 11:04:30 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9DB4UM12265 for ; Mon, 13 Oct 2003 07:04:30 -0400 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9DB4Ur21148 for ; Mon, 13 Oct 2003 07:04:30 -0400 Received: from radish.cambridge.redhat.com (radish.cambridge.redhat.com [172.16.18.90]) by lacrosse.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9DB4TJ11759 for ; Mon, 13 Oct 2003 07:04:29 -0400 Received: from radish.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by radish.cambridge.redhat.com (8.12.10/8.12.7) with ESMTP id h9DB4TSV010417 for ; Mon, 13 Oct 2003 12:04:29 +0100 Received: (from jorton@localhost) by radish.cambridge.redhat.com (8.12.10/8.12.10/Submit) id h9DB4Trf010416 for internals@lists.php.net; Mon, 13 Oct 2003 12:04:29 +0100 Date: Mon, 13 Oct 2003 12:04:29 +0100 To: internals@lists.php.net Message-ID: <20031013110429.GB19957@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: [PATCH] ext/snmp warning fixes From: jorton@redhat.com (Joe Orton) 4.3/ext/snmp/snmp.c: In function `php_snmp_getvalue': 4.3/ext/snmp/snmp.c:282: warning: unsigned int format, long int arg (arg 4) 4.3/ext/snmp/snmp.c:288: warning: int format, long int arg (arg 4) 4.3/ext/snmp/snmp.c: In function `netsnmp_session_gen_auth_key': 4.3/ext/snmp/snmp.c:804: warning: initialization discards qualifiers from pointer target type 4.3/ext/snmp/snmp.c: In function `netsnmp_session_gen_sec_key': 4.3/ext/snmp/snmp.c:833: warning: initialization discards qualifiers from pointer target type 4.3/ext/snmp/snmp.c: In function `php_snmpv3': 4.3/ext/snmp/snmp.c:909: warning: char format, pointer arg (arg 4) The qualifier warnings require some oid * -> const oid * changes which I'd guess would break with older SNMP libraries, so I've not included those fixes. --- ext/snmp/snmp.c 23 Sep 2003 18:26:10 -0000 1.70.2.12 +++ ext/snmp/snmp.c 13 Oct 2003 10:59:11 -0000 @@ -279,13 +279,13 @@ /* ASN_UNSIGNED is the same as ASN_GAUGE */ case ASN_TIMETICKS: /* 0x43, snmp_impl.h */ case ASN_UINTEGER: /* 0x47, snmp_impl.h */ - snprintf(buf, sizeof(buf)-1, "%u", *vars->val.integer); + snprintf(buf, sizeof(buf)-1, "%lu", *vars->val.integer); buf[sizeof(buf)-1]=0; ZVAL_STRING(val, buf, 1); break; case ASN_INTEGER: /* 0x02, asn1.h */ - snprintf(buf, sizeof(buf)-1, "%d", *vars->val.integer); + snprintf(buf, sizeof(buf)-1, "%ld", *vars->val.integer); buf[sizeof(buf)-1]=0; ZVAL_STRING(val, buf, 1); break; @@ -906,7 +906,7 @@ /* Setting the security level. */ convert_to_string_ex(a3); if (netsnmp_session_set_sec_level(&session, Z_STRVAL_PP(a3) TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level: %s", a3); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid security level: %s", Z_STRVAL_PP(a3)); RETURN_FALSE; }