Bug 1772 - There are some strict-aliasing warnings during the compillation
Summary: There are some strict-aliasing warnings during the compillation
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 5.5p1
Hardware: All All
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 21:00 AEST by jchadima
Modified: 2011-01-24 12:33 AEDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jchadima 2010-05-27 21:00:10 AEST
The gcc's strict-aliasing warnings may lead to problems in optimization time, especially in newer versions of the compiler. 

there are the occurences of the warnings:

channels.c :
((struct in_addr *)&dest_addr)->s_addr = INADDR_ANY;

monitor_fdpass.c:
*(int *)CMSG_DATA(cmsg) = fd;
fd = (*(int *)CMSG_DATA(cmsg));

umac.c:
*(UINT32 *)tmp_nonce_lo = ((UINT32 *)nonce)[1];
if ( (((UINT32 *)tmp_nonce_lo)[0] != ((UINT32 *)pc->nonce)[1]) ||
         (((UINT32 *)nonce)[0] != ((UINT32 *)pc->nonce)[0]) )
Comment 1 Damien Miller 2010-05-28 13:49:50 AEST
We set -fno-strict-aliasing already for gcc4:


if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
        CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized"
        GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
        case $GCC_VER in
                1.*) no_attrib_nonnull=1 ;;
                2.8* | 2.9*)
                     CFLAGS="$CFLAGS -Wsign-compare"
                     no_attrib_nonnull=1
                     ;;
                2.*) no_attrib_nonnull=1 ;;
                3.*) CFLAGS="$CFLAGS -Wsign-compare -Wformat-security" ;;
                4.*) CFLAGS="$CFLAGS -Wsign-compare -Wno-pointer-sign -Wformat-s
ecurity -fno-strict-aliasing" ;;
                *) ;;
        esac

Is there something in your environment that is skipping this test?
Comment 2 Damien Miller 2011-01-24 12:33:41 AEDT
Move resolved bugs to CLOSED after 5.7 release