[fpc-pascal] Bus error in ARM architecture

Florian Klaempfl florian at freepascal.org
Thu Sep 18 13:57:16 CEST 2008


Florian Klaempfl schrieb:
>>
>> They also asked me to send them some code which illustrates the
>> problem, which they claim should not exist because the compiler should
>> make sure everything is aligned.
> 
> FPC does too as long as you don't force the compiler to use a certain 
> memory layout like using the packed keyword 

Actually, FPC handles even packed types correctly by assuming that they 
are unaligned so the example below is the worst case but there the 
compiler can't do anything but the user can apply the unaligned keyword 
to tell the compiler that the data is unaligned:

Unaligned(plongint(100003)^):=1234;

> or casting unaligned 
> pointers like plongint(100003)^:=1234;



More information about the fpc-pascal mailing list