Patches item #2835577, was opened at 2009-08-11 16:06
Message generated for change (Settings changed) made by magfr
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=312694&aid=2835577&group_id=12694
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Bart Van Assche (bvassche)
Assigned to: Magnus Fromreide (magfr)
Summary: Fix gcc warning about constant expression
Initial Comment:
When compiling the Net-SNMP source code with GCC, GCC emits several warnings about constant expressions. Many of these are triggered by passing a pointer as the first argument to the macro SNMP_ZERO() of which the compiler knows that it never will be NULL. The attached patch modifies the definition of SNMP_ZERO() such that gcc does not emit a warning when this macro is used.
----------------------------------------------------------------------
>Comment By: Magnus Fromreide (magfr)
Date: 2009-10-15 01:12
Message:
r17797
----------------------------------------------------------------------
Comment By: Magnus Fromreide (magfr)
Date: 2009-10-15 01:12
Message:
Thanks for the patch! It has been applied to the current
development code, and will appear in the next major release
of the Net-SNMP package.
----------------------------------------------------------------------
Comment By: Magnus Fromreide (magfr)
Date: 2009-08-12 23:38
Message:
I agree that plain 0 looks better here. I will apply a thusly upgraded
patch once the trunk thaws.
----------------------------------------------------------------------
Comment By: Bart Van Assche (bvassche)
Date: 2009-08-12 11:28
Message:
The patch silence-SNMP_ZERO also works fine. That patch could even be
improved further by replacing '\0' by 0, which is more readable IMHO.
----------------------------------------------------------------------
Comment By: Magnus Fromreide (magfr)
Date: 2009-08-12 10:52
Message:
I think the original patch is bad - it papers over the problem.
A better patch would be to use plain memset instead of the macro on the
affected locations, does my patch silence-SNMP_ZERO solve the problem for
you?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=312694&aid=2835577&group_id=12694
|