Re: GCC warnings compiling mib2c output

2009-09-17 Thread Bart Van Assche
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

Re: GCC warnings compiling mib2c output

2009-09-16 Thread Dave Shield
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

Re: GCC warnings compiling mib2c output

2009-09-16 Thread Christopher Nelson
 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

Re: GCC warnings compiling mib2c output

2009-09-16 Thread Christopher Nelson
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

Re: GCC warnings compiling mib2c output

2009-09-16 Thread Bart Van Assche
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

Re: GCC warnings compiling mib2c output

2009-09-15 Thread Wes Hardaker
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

Re: GCC warnings compiling mib2c output

2009-09-15 Thread Christopher Nelson
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

GCC warnings compiling mib2c output

2009-09-14 Thread Christopher Nelson
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 =