ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] poundbang


From: llewelly
Subject: Re: [RP] poundbang
Date: Thu Mar 4 04:27:00 2004
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

Shawn Betts <address@hidden> writes:

> "Joshua Neuheisel" <address@hidden> writes:
> 
> > *src/events.c (receive_command): Changed prop_return type to avoid warnings
> > *src/manage.c (get_state): Changed data type to avoid warnings
> 
> I'm actually not getting any warnings about these (I was getting a
> warning and first thot it was what you fixed). Could you explain the
> problem? What version of gcc are you using and which platform?

I'm not the OP (and I've lost track of his message) but I just pulled
    down ratpoison via cvs, and I see these warnings with gcc 3.3.3 on
    freebsd 5.2 :

    $ grep 'warning' gmake.out
    ../../ratpoison/src/events.c:504: warning: dereferencing type-punned
    pointer will break strict-aliasing rules
    ../../ratpoison/src/manage.c:481: warning: dereferencing type-punned
    pointer will break strict-aliasing rules
    $ uname -a
    FreeBSD Zorthluthik.local.bar 5.2-RELEASE-p2 FreeBSD 5.2-RELEASE-p2
    #1: Sat Feb 21 18:13:09 MST 2004
    address@hidden:/usr/obj/usr/src/sys/kernel_trimmed_ipsec_21_feb_2004
    i386
    $ gcc -v
    Using built-in specs.
    Configured with: FreeBSD/i386 system compiler
    Thread model: posix
    gcc version 3.3.3 [FreeBSD] 20031106


A few items about strict aliasing -

    (a) older gccs do not warn for all violations of strict aliasing
        rules.

    (b) strict aliasing is only turned on with -O2, -O3, and
        -fstrict-aliasing; if you are compiling without optimizations,
        you will not see the warning.

    (c) gcc 2.95.1 and gcc 2.95.3 do not turn on strict aliasing at
        -O2 - but gcc 2.95 does turn on strict-aliasing, but does not
        warn at all. (the optimizations were turned off in 2.95.2 and
        2.95.3 because at that time they couldn't generate warnings for
        violations of the rules, and violations of the rules nearly
        always resulted in code the developer did not intend. The
        optimizations were turned back on in gcc 3+, when they could warn
        for 'most' violations.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]