Re:C Portability Lessons from Weird Machines
by radarsat1 on Friday November 16, 2018 @05:13PM
(#18472386)
Yes, it was to do with unaligned reads. Blows my mind that that crashes the program on some architecture, but until I'm personally using such an architecture or have an easy test rig for it, I have a hard time caring. (I did try on qemu.. doesn't crash.)
* It's big-endian
* unaligned reads will fail (if you have to read packed structures, you need to declare the structure as packed and the compiler will generate code to do unaligned reads)
Given you mention "memory layout" it seems you are expecting possibly a little-endian system, and maybe unaligned reads.