You can actually request that x86 machines trap on unaligned accesses too, by setting the AC flag in EFLAGS (pushf; orl $(1<<18), (%esp); popf). Unfortunately, it's common for the C standard library implementation to rely on aligned accesses on x86, so this isn't really feasible.
Comments
You can actually request that x86 machines trap on unaligned accesses too, by setting the AC flag in EFLAGS (pushf; orl $(1<<18), (%esp); popf). Unfortunately, it's common for the C standard library implementation to rely on aligned accesses on x86, so this isn't really feasible.