This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: alias question
- From: "Segher Boessenkool" <segher at kernel dot crashing dot org>
- To: "xorbe" <xorbe at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 18 Feb 2011 03:29:36 +0100 (CET)
- Subject: Re: alias question
- References: <486169.16398.qm@web130206.mail.mud.yahoo.com>
> 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