Home page logo

wireshark logo Wireshark mailing list archives

"Type-punned pointer... breaks anti-aliasing rules" in dfilter-macro.c
From: Stephen Fisher <stephenfisher-wireshark () outlook com>
Date: Tue, 18 Jun 2013 17:14:54 -0600

When trying to compile Wireshark (SVN trunk) on FreeBSD for the first time in a long time, I ran across a familiar 

    dfilter-macro.c: In function 'dfilter_macro_init':
    dfilter-macro.c:614: warning: dereferencing type-punned pointer will break strict-aliasing rules

However, line 614 has a history of being changed between this:

    (void*) &macros,

and this (as it currently is):

    (void**) &macros,

Which is the fifth parameter in a call to uat_new() where parameter five's type is "void** data_ptr" and macros is type 

This was most recently changed with SVN revision 48355 that Anders committed in response to bug 8416 ("remove C++ 
incompatibilities") according to the SVN log.  Before that, judging by the "svn annotate" output in Emacs of a few 
lines earlier, I changed it from (void**) to (void*) way back in 2007 as SVN revision 21330 to "Fix warnings on 
Linux/gcc 4.1.1" and it may have changed at other times as well.

What should the fix ultimately be if one way breaks FreeBSD/gcc 4.2.1 compiles and if it introduces C++ compatibility 
issues (which I'm not familiar with since I haven't been following development for a while lately).                     
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]