Gentoo Archives: gentoo-dev

From: Ryan Hill <dirtyepic@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [RFC] Ideas for projects...
Date: Fri, 26 Jan 2007 22:59:44
Message-Id: epe0to$bet$1@sea.gmane.org
In Reply to: Re: [gentoo-dev] [RFC] Ideas for projects... by sanchan
1 sanchan wrote:
2 > missing -fno-strict-aliasing wherever there are bad programming
3 > practices and so on;
4
5 IIUC, GCC's current -Wstrict-aliasing implementation has a number of
6 flaws. According to a recent thread[i] on the GCC ml..
7
8 > The current implementation of -Wstrict-aliasing looks at a single expression
9 > at once. Although it does OK given the limited scope, it has several drawbacks.
10 > First, it produces false positives, i.e., it warns when it should not.
11 > For instance, it warns about pointer conversions even when the pointers
12 > are never dereferenced.
13 > Second, it has many false negatives, i.e., it does not warn when it should.
14 > It does not warn when an address is not taken, for instance:
15 > float *f = ...
16 > int *i = (int*)f;
17 > Third, it does not display the name or type of the aliased objects, which
18 > makes the warnings hard to understand in templates or macros.
19
20 Until that improves it might be a good idea to take strict aliasing
21 warnings with a grain of salt.
22
23
24 [i] http://permalink.gmane.org/gmane.comp.gcc.patches/131449
25
26 --
27 by design, by neglect
28 dirtyepic gentoo org for a fact or just for effect
29 9B81 6C9F E791 83BB 3AB3 5B2D E625 A073 8379 37E8 (0x837937E8)

Attachments

File name MIME type
signature.asc application/pgp-signature