URL:
  <http://gna.org/bugs/?13711>

                 Summary: g++-4.4 warnings in network.cpp
                 Project: Battle for Wesnoth
            Submitted by: conscious
            Submitted on: Среда 17.06.2009 at 09:35
                Category: Bug
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Networking
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.6.2
        Operating System: Ubuntu 9.10

    _______________________________________________________

Details:

When building Wesnoth 1.6.2 with gcc 4.4, there are warnings associated with
calls to SDLNet_Write32 and SDLNet_Read32 in network.cpp:

$ i486-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..   -I/usr/include -D_REENTRANT
-I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/directfb -I/usr/include/libpng12     -DHAVE_REVISION -I../intl
-I../intl -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
-DWESNOTH_PATH=\"/usr/share/games/wesnoth\" -DLOCALEDIR=\"/usr/share/locale\"
-DHAS_RELATIVE_LOCALEDIR=0 -DFIFODIR=\"/var/run/wesnothd\"
-DWESNOTH_PREFIX=\"/usr\" -DHAVE_FRIBIDI -I/usr/include -O2 -W -Wall -ansi -g
-O2 -Werror -Wno-unused -Wno-sign-compare -DDISABLE_POOL_ALLOC -D_X11    
-I/usr/include -MT network.o -MD -MP -MF $depbase.Tpo -c -o network.o
src/network.cpp
cc1plus: warnings being treated as errors
src/network.cpp: In member function 'virtual void
network::<unnamed>::connect_operation::run()':
src/network.cpp:432: error: dereferencing type-punned pointer will break
strict-aliasing rules
src/network.cpp: In function 'network::connection
network::accept_connection()':
src/network.cpp:560: error: dereferencing type-punned pointer will break
strict-aliasing rules
src/network.cpp:575: error: dereferencing type-punned pointer will break
strict-aliasing rules
src/network.cpp: In function 'network::connection
network::receive_data(config&, network::connection, bool*,
network::bandwidth_in_ptr*)':
src/network.cpp:708: error: dereferencing type-punned pointer will break
strict-aliasing rules
src/network.cpp: In function 'network::connection
network::receive_data(std::vector<char, std::allocator<char> >&,
network::bandwidth_in_ptr*)':
src/network.cpp:818: error: dereferencing type-punned pointer will break
strict-aliasing rules

$ i486-linux-gnu-g++ --version
i486-linux-gnu-g++ (Ubuntu 4.4.0-6ubuntu2) 4.4.0
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I encountered this problem when helping package Wesnoth for Ubuntu 9.10
karmic. I solved it with -fno-strict-aliasing, but I guess it can worsen
performance.

This may apply to trunk, too.




    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?13711>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to