[ wxwindows-Bugs-1618449 ] Some warnings under Linux (compile g++ 4.1.2)

SourceForge.net noreply at sourceforge.net
Fri Apr 13 19:20:04 PDT 2007


Bugs item #1618449, was opened at 2006-12-18 15:01
Message generated for change (Comment added) made by sf-robot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1618449&group_id=9863

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: Build -- unix
Group: Trivial
>Status: Closed
Resolution: None
Priority: 6
Private: No
Submitted By: Steven Van Ingelgem (g00fy)
Assigned to: Nobody/Anonymous (nobody)
Summary: Some warnings under Linux (compile g++ 4.1.2)

Initial Comment:
/usr/include/wx-2.8/wx/hashmap.h: In member function ‘wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::
GetNodePtr(const long int&) const’:
/usr/include/wx-2.8/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/gdicmn.h: In member function ‘wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_Hash
Table::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/gdicmn.h:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function ‘wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTa
ble::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function ‘wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTabl
e::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules



Greetz :)

----------------------------------------------------------------------

>Comment By: SourceForge Robot (sf-robot)
Date: 2007-04-13 19:20

Message:
Logged In: YES 
user_id=1312539
Originator: NO

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

----------------------------------------------------------------------

Comment By: Marcin Wojdyr (wojdyr)
Date: 2007-04-09 13:51

Message:
Logged In: YES 
user_id=586843
Originator: NO

All these warnings are from methods:
wx...._wxImplementation_HashTable::GetNodePtr(const long int&) const

After preprocessing, this line makes the problem: 
node = (Node**)&(*node)->m_nxt;

The method looks like this:

      Node** GetNodePtr( const const_key_type& key ) const
      {
        size_t bucket = m_hasher( key ) % m_tableBuckets;
        Node** node = &m_table[bucket];
        while( *node )
          {
            if( m_equals( m_getKey( (*node)->m_value ), key ) )
                return node;
            node = (Node**)&(*node)->m_nxt;
          }
        return __null;
      }



----------------------------------------------------------------------

Comment By: Vadim Zeitlin (vadz)
Date: 2007-01-07 14:51

Message:
Logged In: YES 
user_id=71618
Originator: NO

I've just realized that we already do use -fno-strict-aliasing so I
understand even less why is this warning given. Could you please show the
compiler command line?

----------------------------------------------------------------------

Comment By: Vadim Zeitlin (vadz)
Date: 2007-01-06 17:47

Message:
Logged In: YES 
user_id=71618
Originator: NO

We really need to fix this but for this we need to understand where exacty
(for which pointer) this is given which would probably require
preprocessing the code (to expand the macro) and then compiling it.

For now the workaround is to use -fno-strict-aliasing gcc option.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1618449&group_id=9863




More information about the wx-dev mailing list