Bug 389631 - net-snmp: invalid lvalue in assignment
net-snmp: invalid lvalue in assignment
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: net-snmp (Show other bugs)
8
All Linux
low Severity high
: ---
: ---
Assigned To: Jan Safranek
Fedora Extras Quality Assurance
: Regression
Depends On:
Blocks: 219025
  Show dependency treegraph
 
Reported: 2007-11-18 13:55 EST by Bernard Johnson
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-19 09:59:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernard Johnson 2007-11-18 13:55:43 EST
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 09:30:34 EST
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 09:59:23 EST
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 17:30:34 EST
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.