2x Warning:dereferencing pointer 'sockaddr.X' does break strict-aliasing rules [-Wstrict-aliasing] #1556

issue Diapolo opened this issue on July 4, 2012
  1. Diapolo commented at 3:44 PM on July 4, 2012: none

    I get those on Windows when compiling with IPv6 support enabled:

    Warning:dereferencing pointer 'sockaddr.502' does break strict-aliasing rules [-Wstrict-aliasing] SOCKET hSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); https://github.com/bitcoin/bitcoin/blob/master/src/netbase.cpp#L335

    Warning:dereferencing pointer 'sockaddr.1359' does break strict-aliasing rules [-Wstrict-aliasing] SOCKET hListenSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP); https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L1723

  2. Diapolo commented at 5:23 PM on July 18, 2012: none

    This is not a problem when using GCC 4.7, but it IS one with GCC 4.4 (the compiler shipping with the current Qt SDK on Windows).

  3. Diapolo commented at 12:29 PM on September 21, 2012: none

    @sipa I'm not sure if this needs fixing, but I dunno how anyway. If you consider this to be a non-issue just close it!

  4. Diapolo commented at 1:10 AM on January 26, 2013: none

    This warning doesn't happen with recent MinGW version. @sipa Should this be fixed and if no you are free to close this!

  5. Diapolo commented at 6:58 AM on May 8, 2013: none

    @sipa Another ping... trying to get some things closed or looked at ^^.

  6. laanwj commented at 3:35 PM on November 12, 2013: member

    Closing as it doesn't happen with recent mingw.

  7. laanwj closed this on Nov 12, 2013

  8. suprnurd referenced this in commit a3c8cb20df on Dec 5, 2017
  9. lateminer referenced this in commit 5ba10f0d58 on May 6, 2020
  10. DrahtBot locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me