Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
Below are two example functions foo() and boo(), that I think both are
valid from the POV of strict aliasing rules. GCC 4.2 either warns about
both (with -Wstrict-aliasing=2) or doesn't warn about any (with
Sergei Organov writes:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
$ cat alias.c
typedef struct { int i; } S;
int i;
int foo()
{
S const sc = { 10 };
i = 20;
// Accessing object 'i' of type 'int' through 'S'
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
$ cat alias.c
typedef struct { int i; } S;
int i;
int foo()
{
S const sc = { 10 };
i = 20;
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
int float_as_int()
{
h1.f = 1;
H0 h0 = *(H0*)h1.f; // Should be OK? No, it is
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
int float_as_int()
{
h1.f = 1;
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
int
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov
Sergei Organov writes:
If we come back to strict aliasing rules, then I will have to refer once
again to already cited place in the standard that says that I'm
permitted to access an object not only through a compatible type, but
also through a structure containing a field of compatible
On Jan 11, 2007, at 6:30 AM, Sergei Organov wrote:
So h1.f is not an object? If it is not, it brings us back to the
validity of my boo() function from the initial post, for which 2
persons
(3 including me) thought it's OK:
Would be nice for you to raise the issue directly with the C
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
If we come back to strict aliasing rules, then I will have to refer once
again to already cited place in the standard that says that I'm
permitted to access an object not only through a compatible type, but
also through a
Mike Stump [EMAIL PROTECTED] writes:
On Jan 11, 2007, at 6:30 AM, Sergei Organov wrote:
So h1.f is not an object? If it is not, it brings us back to the
validity of my boo() function from the initial post, for which 2
persons
(3 including me) thought it's OK:
Would be nice for you to raise
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
If we come back to strict aliasing rules, then I will have to refer once
again to already cited place in the standard that says that I'm
permitted to access an object not only through a
Sergei Organov writes:
BTW, I've tried once to raise similar aliasing question in
comp.std.c++. The result was that somebody started to talk about
validity of pointers conversions that IMHO has nothing to do with
strict aliasing,
It's the same issue.
and the discussion died.
It is
Sergei Organov wrote:
Ian Lance Taylor [EMAIL PROTECTED] writes:
Sergei Organov [EMAIL PROTECTED] writes:
Below are two example functions foo() and boo(), that I think both are
valid from the POV of strict aliasing rules. GCC 4.2 either warns about
both (with -Wstrict-aliasing=2) or
Silvius Rus [EMAIL PROTECTED] writes:
[...]
I am about to submit a patch that implements -Wstrict-aliasing in the
backend based on flow-sensitive points-to information, which is
computed by analyzing the entire source of each function. It is not
perfect (the problem is undecidable), but it
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
BTW, I've tried once to raise similar aliasing question in
comp.std.c++. The result was that somebody started to talk about
validity of pointers conversions that IMHO has nothing to do with
strict aliasing,
It's the
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
Andrew Haley [EMAIL PROTECTED] writes:
Sergei Organov writes:
If we come back to strict aliasing rules, then I will have to refer
once
again to already cited place in the standard that says that I'm
Andrew Pinski wrote:
Third, it only checks C programs (and not C++).
This has not been true for some time now (at least developmental wise).
-- Pinski
Oops, had not noticed that. Forget third argument then.
Silvius
Sergei Organov [EMAIL PROTECTED] writes:
Below are two example functions foo() and boo(), that I think both are
valid from the POV of strict aliasing rules. GCC 4.2 either warns about
both (with -Wstrict-aliasing=2) or doesn't warn about any (with
-Wstrict-aliasing), and generates the
It is possible that somebody else will disagree with me.
FWIW, our currently aliasing set implementation agrees with you on
both counts :)
20 matches
Mail list logo