On Wed, Sep 16, 2009 at 4:07 PM, Christopher Nelson
chris.nelson.1...@gmail.com wrote:
I suppose you could consider tweaking the call to use 'void' rather
than 'char' pointers. In retrospect, that would have been a better
choice, and might keep your compiler happy. But note that this
2009/9/14 Christopher Nelson chris.nelson.1...@gmail.com:
Recently, we upgraded compilers and we're seeing a lot of
warnings about dereferencing type-punned pointer will break
strict-aliasing rules
Well, the warning is technically correct.
The memdup call *does* re-cast these pointers in a
Recently, we upgraded compilers and we're seeing a lot of
warnings about dereferencing type-punned pointer will break
strict-aliasing rules
Well, the warning is technically correct.
The memdup call *does* re-cast these pointers in a potentially
non-safe manner. But memdup is working with
I suppose you could consider tweaking the call to use 'void' rather
than 'char' pointers. In retrospect, that would have been a better
choice, and might keep your compiler happy. But note that this
change would have to be applied throughout the whole codebase.
I'm running up against a
On Wed, Sep 16, 2009 at 2:08 PM, Christopher Nelson
chris.nelson.1...@gmail.com wrote:
I suppose you could consider tweaking the call to use 'void' rather
than 'char' pointers. In retrospect, that would have been a better
choice, and might keep your compiler happy. But note that this
On Mon, 14 Sep 2009 15:44:58 -0400, Christopher Nelson
chris.nelson.1...@gmail.com said:
CN if (retval) {
CN ui = SNMP_MALLOC_STRUCT(undoInfo);
ui- len = retval_len;
CN memdup((u_char **) ui-ptr,
CN (u_char *) retval, ui-len);
CN }
CN which I believe is mib2c output, not something we added
CN if (retval) {
CN ui = SNMP_MALLOC_STRUCT(undoInfo);
ui- len = retval_len;
CN memdup((u_char **) ui-ptr,
CN (u_char *) retval, ui-len);
CN }
CN which I believe is mib2c output, not something we added to the
CN skeleton. Has this warning been addressed in later versions?
Later
We're using Net-SNMP 5.2.2. Some time ago, we generated MIB code with
mib2c. Recently, we upgraded compilers and we're seeing a lot of
warnings about dereferencing type-punned pointer will break
strict-aliasing rules in code like:
if (retval) {
ui =