This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Alignment Guarantees?
- From: Jeffrey Walton <noloader at gmail dot com>
- To: GCC Users List <gcc-help at gcc dot gnu dot org>
- Date: Mon, 5 Mar 2012 01:04:12 -0500
- Subject: Alignment Guarantees?
- Authentication-results: mr.google.com; spf=pass (google.com: domain of noloader@gmail.com designates 10.52.35.12 as permitted sender) smtp.mail=noloader@gmail.com; dkim=pass header.i=noloader@gmail.com
- Reply-to: noloader at gmail dot com
Hi All,
Does C/C++ or GCC offer any alignment guarantees? I'm looking at some
code for ARM that does not look quite right.
void foo(__u8 my_arr[64])
{
...
for(int i = 0; i < 16; i++)
(__u32*)my_arr[i] = ...
}
Casting a u8[] to something else has caused a lot of intermittent
problems on Windows Mobile (ARM) in the past.
Jeff