Hello.

Recently I get the following error when I try to build CVS HEAD using a default
configure:

../../../net-snmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c: In 
function '_mfd_ifTable_undo_setup_allocate':
../../../net-snmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c:1410: 
error: invalid lvalue in increment
../../../net-snmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c: In 
function '_mfd_ifTable_undo_setup_release':
../../../net-snmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c:1489: 
error: invalid lvalue in decrement

It seems this is the cast-as-lvalue gcc extension, of which the release notes
for gcc 4.0 (http://gcc.gnu.org/gcc-4.0/changes.html) says:

* The cast-as-lvalue, conditional-expression-as-lvalue and
  compound-expression-as-lvalue extensions, which were deprecated in 3.3.4
  and 3.4, have been removed.

If I apply the attached path it works for me but I am not certain about the
correctness of the patch.

/MF
Index: agent/mibgroup/if-mib/ifTable/ifTable_interface.c
===================================================================
RCS file: 
/cvsroot/net-snmp/net-snmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c,v
retrieving revision 1.17
diff -u -r1.17 ifTable_interface.c
--- agent/mibgroup/if-mib/ifTable/ifTable_interface.c   15 Jan 2006 14:11:39 
-0000      1.17
+++ agent/mibgroup/if-mib/ifTable/ifTable_interface.c   26 Jan 2006 22:09:14 
-0000
@@ -1407,7 +1407,7 @@
         dl = netsnmp_get_list_node(rowreq_ctx->ifTable_data_list,
                                    "ifentry:undo");
         netsnmp_assert(NULL != dl);
-        ++((int)dl->data);
+        ++*((int*)&dl->data);
         DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_setup_allocate",
                     "++refcount = %d\n",(int)dl->data));
     }
@@ -1486,7 +1486,7 @@
     if (NULL == dl)
         return; /* better to lead than double free */
 
-    --((int)dl->data);
+    --*((int*)&dl->data);
     snmp_log(LOG_ERR, "--refcount at %d\n", (int)dl->data);
 
     if (0 == (int)dl->data) {

Reply via email to