2008/5/20 Magnus Fromreide <[EMAIL PROTECTED]>:
[..]
> Bug [1] is due to the fact that ntop #defines free to something that
> require an l-value as an argument, just as Jan Safranek states.
>
> Further, #defining any name reserved by the standard means the program
> is out in undefined behaviour-land and deserve what it get, i.e. ntop
> isn't written in C but in something else and thus can't expect to
> interface cleanly with C libraries.
>
[..]
> Fix your code!
>
Thanks for your answer. :) I regret I did no good deal of prelim work
on my part,
 but my intension was just to get my doubts clear.

Fixed for the time being : https://bugzilla.redhat.com/show_bug.cgi?id=448397
There was already an attempt to fix it here but this didn't eliminated problem:
https://svn.ntop.org/trac/changeset/3112

Fixed for time being as done in here:
http://lists.opensuse.org/opensuse-commit/2007-08/msg00555.html

>> and rpm build
>> >  (as mentioned in last remark at [2]).
>> >             SNMP_FREE assume that the value passed there is l-value, but
>> >  net-snmp passes r-value -> compilation error at
>> >
>> > include/net-snmp/library/container.h: Line 440
>
> As for comment #117 in [2], please see above.
>
> /MF

If my temporary fix can be improved in any way please inform at above
bugzilla bug link.
I will open up a bug in ntop sourceforge tracker or track ASAP.

-- 
Thanks,
Rakesh Pandit

Patch:


--- ntop-3.3.org/globals-core.h 2008-05-26 14:33:47.000000000 +0530
+++ ntop-3.3/globals-core.h     2008-05-26 14:34:09.000000000 +0530
@@ -258,8 +258,6 @@

 /* Fix to the free prototype courtesy of Tanner Lovelace
<[EMAIL PROTECTED]> */
 /* Fix free() courtesy of Benoit Dolez <[EMAIL PROTECTED]> */
-#define free(a)       { void *__t = (a);
ntop_safefree((void**)&(__t), __FILE__, __LINE__); a = __t; }
-extern void           ntop_safefree(void **ptr, char* file, int line);
 #define malloc(sz)    ntop_safemalloc(sz, __FILE__, __LINE__)
 extern void*          ntop_safemalloc(unsigned int sz, char* file, int line);
 #define calloc(c,sz)  ntop_safecalloc(c, sz, __FILE__, __LINE__)
_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to