Bug 389631 - net-snmp: invalid lvalue in assignment
Summary: net-snmp: invalid lvalue in assignment
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp
Version: 8
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Jan Safranek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
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

(edit)
Clone Of:
(edit)
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):
net-snmp-5.4.1-4.fc8

How reproducible:
Always

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
3.
  
Actual results:
http://koji.fedoraproject.org/koji/taskinfo?taskID=247309
http://koji.fedoraproject.org/koji/getfile?taskID=247321&name=build.log

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);
        ntop_safefree((void**)&(__t),
"/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.