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 potentially
non-safe manner.   But memdup is working with raw memory,
so this isn't really a problem.

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 not sure whether this is something we would be prepared to
do for the standard distributions.   Particularly since it would
presumably impact on third-party code.   Wes - care to comment?

We might also need to consider changing the name at some point
(?to netsnmp_memdup) since a number of other packages also
define a routine "memdup".   Often with a different API template
(typically returning the new buffer as the result of the call, rather
than passing this via the first parameter).
   Again, I'm not sure why we went the way we did, but it's probably
too late to change now.


Dave

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to