Bug 389631 - net-snmp: invalid lvalue in assignment
Summary: net-snmp: invalid lvalue in assignment
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp
Version: 8
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jan Safranek
QA Contact: Fedora Extras Quality Assurance
Keywords: Regression
Depends On:
Blocks: 219025
TreeView+ depends on / blocked
Reported: 2007-11-18 18:55 UTC by Bernard Johnson
Modified: 2007-11-30 22:12 UTC (History)
0 users

Clone Of:
Last Closed: 2007-11-19 14:59:23 UTC

Attachments (Terms of Use)

Description Bernard Johnson 2007-11-18 18:55:43 UTC
Description of problem:
Build against net-snmp-devel terminates with "invalid lvalue in assignment"

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. wget http://bjohnson.fedorapeople.org/ntop-3.3-3.fc8.src.rpm
2. koji build --scratch dist-f8-updates-candidate ntop-3.3-3.fc8.src.rpm
Actual results:

Expected results:
clean build

Additional info:
This is a regression from F7.

Comment 1 Jan Safranek 2007-11-19 14:30:34 UTC
The memory deallocation in ntop collides with the one in net-snmp and new gcc.
After all macros are expanded I get in containers.h:440:

if (((void *)0) != x->container_name)
  do { 
    if (x->container_name) { 
        void *__t = ((void *)x->container_name);
"/usr/include/net-snmp/library/container.h", 440); 
        (void *)x->container_name = __t;
      x->container_name=((void *)0); 
  } while(0);

I do not see anything wrong at the first sight, I'll try to investigate it. The
code is perfectly compilable with gcc in Fedora 7.

Comment 2 Jan Safranek 2007-11-19 14:59:23 UTC
The line "(void *)x->container_name = __t;" is syntactically wrong, cast (void*)
does not result in l-value, see ISO C, section 6.5.4, 

You redefine free() and you assume that the value passed there is l-value, but
net-snmp passes r-value -> compilation error. Your free() should accept r-value
instead, as usual function call.

Comment 3 Bernard Johnson 2007-11-19 22:30:34 UTC
Thanks for your very timely response.  I'll try to get that fixed.

Note You need to log in before you can comment on or make changes to this bug.