alias question

Segher Boessenkool segher@kernel.crashing.org
Fri Feb 18 04:25:00 GMT 2011


> If I have a char array, and it's always written by the char array, can it
> be always reliably read by any combination of short/int/long pointers?
>
> As I understand, the compiler will see byte writes for all types, so
> readind shoulg be fine without violating any strict alias rules.  Just
> can't write the array by any other type than char[] access.  Right?

No.  You can access anything only as its declared type or character type;
an array of char thus can be accessed as char only.


Segher



More information about the Gcc-help mailing list