On Fri, Jul 8, 2011 at 12:52 PM, Øyvind Harboe <oyvind.har...@zylin.com>wrote:

> What puzzles me is that there is no warning on x86, even if I the
> -Wcast-align option
> is there....
>
> ....
> -Wcast-align
>    Warn whenever a pointer is cast such that the required alignment
> of the target is increased. For example, warn if a char * is cast to
> an int * on machines where integers can only be accessed at two- or
> four-byte boundaries.
> ----
>
>
"on machines where integers can only be accessed at two- or four-byte
boundaries"

x86 is not such a machine, it supports unaligned access. Which is why it's
good to do a cross-compile to another arch regularly to catch these
problems. It would be good if there was an option to emit these warnings
regardless. Maybe there is.

I looked briefly at the memory read functions in mips32_dmaacc.c and
mips32_pracc.c and it looks like the type usage is a bit confused. The
difference between the *_read_mem{32,16,8} functions should only be what
kind of access is made *on the target*. Host data buffer type should be
identical, preferrably void*, with no alignment requirement, and count
should be in number of bytes.

/Andreas
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to