On 6/26/07, Herman Geza <[EMAIL PROTECTED]> wrote:
Let me elaborate. If the compiler can detect invalid type-punning,
Not really.
void foo(float *a) { int *b = (int*)a; // type-punning warning }
This is actually valid if we don't access both a and b and also the original type is int.
Is this reasonable?
Not really, see above. Aliasing is a hard problem to solve in generic. So there are stuff like type based aliasing to help out the solver. And in the case of GCC, it helps out more than other compilers. -- Pinski