This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCHes] Misc aliasing fixes for building DLL with gcc-4.5.0
- From: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>
- To: cygwin-patches <cygwin-patches at cygwin dot com>
- Date: Tue, 17 Aug 2010 14:23:32 -0500
- Subject: Re: [PATCHes] Misc aliasing fixes for building DLL with gcc-4.5.0
- References: <4A7F8FF5.5060701@gmail.com>
On Mon, 2009-08-10 at 04:11 +0100, Dave Korn wrote:
> I tried compiling winsup with GCC-4.5.0 HEAD, and it finds a bunch of things
> to complain about (which then break the -Werror build). They are mostly
> "dereferencing type-punned pointer will break strict-aliasing rules" errors, but
> there is also some possibly-undefined behaviour in passwd.cc (looks like a
> problem with sequence points to me).
Sorry to resurrect such an old thread, but now that Dave released
gcc-4.5, this is no longer theoretical. Here are the warnings-as-errors
that I get with gcc-4.5.1 with Dave's 4.5.0 patch set:
winsup/cygwin/fhandler_floppy.cc: In member function âint
fhandler_dev_floppy::get_drive_info(hd_geometry*)â:
winsup/cygwin/fhandler_floppy.cc:59:37: error: dereferencing type-punned
pointer will break strict-aliasing rules
winsup/cygwin/fhandler_socket.cc: In function âbool address_in_use(const
sockaddr*)â:
winsup/cygwin/fhandler_socket.cc:918:7: error: dereferencing type-punned
pointer will break strict-aliasing rules
winsup/cygwin/fhandler_socket.cc:918:7: error: dereferencing type-punned
pointer will break strict-aliasing rules
winsup/cygwin/hookapi.cc: In function âvoid* hook_or_detect_cygwin(const
char*, const void*, WORD&)â:
winsup/cygwin/hookapi.cc:255:7: error: âiâ may be used uninitialized in
this function
winsup/cygwin/passwd.cc: In function âpasswd*
internal_getpwsid(cygpsid&)â:
winsup/cygwin/passwd.cc:101:54: error: operation on âpwâ may be
undefined
winsup/cygwin/syscalls.cc: In function âlong int gethostid()â:
winsup/cygwin/syscalls.cc:3711:43: error: dereferencing type-punned
pointer will break strict-aliasing rules
winsup/cygwin/syscalls.cc:3712:49: error: dereferencing type-punned
pointer will break strict-aliasing rules
Yaakov