Re: Yet another aliasing question.

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

 



Andrew Haley <aph@xxxxxxxxxx> writes:

> Sergei Organov writes:
>
>  > I'm trying to understand the implications of strict aliasing rules on
>  > programming practices. I've got two example functions foo() and boo()
>  > that I think both are valid from the POV of strict aliasing
>  > rules.
>
> It's hard to discuss this without looking at the standard.  Can you
> please quote the exact language in the standard thta justfies your
> opinion?

Yes, sure:

  An object shall have its stored value accessed only by an lvalue
  expression that has one of the following types:

  - a type compatible with the effective type of the object,
  [...]
  - an aggregate or union type that includes one of the aforementioned
    types among its members (including, recursively, a member of a
    subaggregate or contained union)


-- Sergei.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux