--gE7i1rD7pdK0Ng3j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On 2007-07-04 15:50:46 -0400, Robert Story wrote:
> On Wed, 4 Jul 2007 20:15:27 +0100 Dave wrote:
> DS> On 04/07/07, Marcus Rueckert wrote:
> DS> > ok after another discussion on irc with robert and thomas, we got v2 of
> DS> > the patch. instead of removing the asserts we make the conditions static
> DS> > strings. the compiler shuts up and robert still gets his debug message.
> DS>
> DS> Why is the first assertion of the form:
> DS> netsnmp_assert( "string" );
> DS>
> DS> while all of the others are of the form:
> DS> netsnmp_assert( !"string" );
> DS>
> DS> Surely this will behave in a different manner to all of the others?
> DS> (Presumably never being displayed)
>
> Quite right. I expect a revised patch from Marcus shortly...


here we go. the final one. i hope

please vote!

darix

--
openSUSE - SUSE Linux is my linux
openSUSE is good for you
www.opensuse.org

--gE7i1rD7pdK0Ng3j
Content-Type: text/x-patch; charset=us-ascii
Content-Disposition: attachment;
filename="net-snmp-5.4.1.rc1_useless_asserts.patch"

Index: agent/agent_registry.c
================================================== =================
--- agent/agent_registry.c.orig 2007-07-04 22:27:32.169270923 +0200
+++ agent/agent_registry.c 2007-07-04 22:28:41.053417949 +0200
@@ -532,7 +532,7 @@ netsnmp_subtree_load(netsnmp_subtree *ne

if (next && (next->namelen == new_sub->namelen) &&
(next->priority == new_sub->priority)) {
- netsnmp_assert("registration" != "duplicate");
+ netsnmp_assert(!"registration != duplicate"); /* always false */
return MIB_DUPLICATE_REGISTRATION;
}

@@ -626,7 +626,7 @@ netsnmp_register_mib(const char *moduleN
snmp_log(LOG_WARNING,"context passed during registration does not "
"equal the reginfo contextName! ('%s' != '%s')\n",
context, reginfo->contextName);
- netsnmp_assert("register context" == "reginfo->contextName");
+ netsnmp_assert(!"register context == reginfo->contextName"); /* always false */
}

/* Create the new subtree node being registered. */
Index: agent/mibgroup/ip-forward-mib/data_access/route_common.c
================================================== =================
--- agent/mibgroup/ip-forward-mib/data_access/route_common.c.orig 2007-07-04 22:27:32.169270923 +0200
+++ agent/mibgroup/ip-forward-mib/data_access/route_common.c 2007-07-04 22:28:41.053417949 +0200
@@ -173,7 +173,7 @@ netsnmp_access_route_entry_set(netsnmp_r
}
else {
snmp_log(LOG_ERR,"netsnmp_access_route_entry_set with no mode\n");
- netsnmp_assert("route_entry_set" == "unknown mode");
+ netsnmp_assert(!"route_entry_set == unknown mode"); /* always false */
rc = -1;
}

Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c
================================================== =================
--- agent/mibgroup/ip-mib/data_access/ipaddress_common.c.orig 2007-07-04 22:27:32.169270923 +0200
+++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2007-07-04 22:28:41.073419153 +0200
@@ -239,7 +239,7 @@ netsnmp_access_ipaddress_entry_set(netsn
}
else {
snmp_log(LOG_ERR,"netsnmp_access_ipaddress_entry_set with no mode\n");
- netsnmp_assert("ipaddress_entry_set" == "unknown mode");
+ netsnmp_assert(!"ipaddress_entry_set == unknown mode"); /* always false */
rc = -1;
}

Index: agent/mibgroup/mibII/icmp.c
================================================== =================
--- agent/mibgroup/mibII/icmp.c.orig 2007-07-04 22:27:32.169270923 +0200
+++ agent/mibgroup/mibII/icmp.c 2007-07-04 22:28:41.093420357 +0200
@@ -178,7 +178,7 @@ icmp_handler(netsnmp_mib_handler
icmp_load(NULL, NULL);
#elif !defined(hpux11)
if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
- netsnmp_assert("cache" == "valid"); /* always false */
+ netsnmp_assert(!"cache == valid"); /* always false */
icmp_load( NULL, NULL ); /* XXX - check for failure */
}
#endif
Index: agent/mibgroup/mibII/ip.c
================================================== =================
--- agent/mibgroup/mibII/ip.c.orig 2007-07-04 22:27:32.169270923 +0200
+++ agent/mibgroup/mibII/ip.c 2007-07-04 22:28:41.109421321 +0200
@@ -250,7 +250,7 @@ ip_handler(netsnmp_mib_handler
ip_load(NULL, NULL);
#elif !defined(hpux11)
if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
- netsnmp_assert("cache" == "valid"); /* always false */
+ netsnmp_assert(!"cache == valid"); /* always false */
ip_load( NULL, NULL ); /* XXX - check for failure */
}
#endif
Index: agent/mibgroup/mibII/tcp.c
================================================== =================
--- agent/mibgroup/mibII/tcp.c.orig 2007-07-04 22:27:32.169270923 +0200
+++ agent/mibgroup/mibII/tcp.c 2007-07-04 22:28:41.125422284 +0200
@@ -215,7 +215,7 @@ tcp_handler(netsnmp_mib_handler
tcp_load(NULL, NULL);
#elif !defined(hpux11)
if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
- netsnmp_assert("cache" == "valid"); /* always false */
+ netsnmp_assert(!"cache == valid"); /* always false */
tcp_load( NULL, NULL ); /* XXX - check for failure */
}
#endif
Index: agent/mibgroup/mibII/udp.c
================================================== =================
--- agent/mibgroup/mibII/udp.c.orig 2007-07-04 22:27:32.173271164 +0200
+++ agent/mibgroup/mibII/udp.c 2007-07-04 22:28:41.141423247 +0200
@@ -197,7 +197,7 @@ udp_handler(netsnmp_mib_handler
udp_load(NULL, NULL);
#elif !defined(hpux11)
if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
- netsnmp_assert("cache" == "valid"); /* always false */
+ netsnmp_assert(!"cache == valid"); /* always false */
udp_load( NULL, NULL ); /* XXX - check for failure */
}
#endif
Index: snmplib/data_list.c
================================================== =================
--- snmplib/data_list.c.orig 2007-07-04 22:27:32.173271164 +0200
+++ snmplib/data_list.c 2007-07-04 22:28:41.157424211 +0200
@@ -105,7 +105,7 @@ netsnmp_data_list_add_node(netsnmp_data_

DEBUGMSGTL(("data_list","adding key '%s'\n", node->name));
if (0 == strcmp(node->name, (*head)->name)) {
- netsnmp_assert("list key" == "is unique"); /* always fail */
+ netsnmp_assert(!"list key == is unique"); /* always fail */
snmp_log(LOG_WARNING,
"WARNING: adding duplicate key '%s' to data list\n",
node->name);
@@ -114,7 +114,7 @@ netsnmp_data_list_add_node(netsnmp_data_
for (ptr = *head; ptr->next != NULL; ptr = ptr->next) {
netsnmp_assert(NULL != ptr->name);
if (0 == strcmp(node->name, ptr->name)) {
- netsnmp_assert("list key" == "is unique"); /* always fail */
+ netsnmp_assert(!"list key == is unique"); /* always fail */
snmp_log(LOG_WARNING,
"WARNING: adding duplicate key '%s' to data list\n",
node->name);

--gE7i1rD7pdK0Ng3j
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--gE7i1rD7pdK0Ng3j
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--gE7i1rD7pdK0Ng3j--