[Scummvm-devel] Wii & Gamecube (resp. PowerPC) vs. unaligned memory access
Marcus Comstedt
marcus at mc.pp.se
Fri May 6 19:20:30 CEST 2011
Andre Heider <a.heider at gmail.com> writes:
> Confusing? Yes. But reading "return *(const uint32 *)(ptr);" makes me
> wonder if need_memalign has a confusing name in the first place. If I
> read GCC's manpage about -fstrict-aliasing right, that may also be
> undefined behaviour.
If there is code in the same function which writes to whatever ptr
points to, then the behaviour can be undefined behaviour, yes (the
order of the read and write operations may be changed by the
compiler). Aliasing only matters when you have write accesses. I'm
assuming most of the unaligned stuff is about reading from constant
game data, yes?
// Marcus
More information about the Scummvm-devel
mailing list