<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-2" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff><FONT size=2 face=Arial>
<DIV>Hi<BR></DIV>
<DIV>If I crosscompile the folowing program
with<BR>Lazarus-0.9.29-21694-fpc-2.3.1-20090914-win32.exe
and<BR>Lazarus-0.9.29-21694-fpc-2.3.1-20090914-cross-arm-wince-win32.exe:</DIV>
<DIV> </DIV>
<DIV>program test4;</DIV>
<DIV> </DIV>
<DIV>{$MODE Delphi}<BR>{$APPTYPE CONSOLE}</DIV>
<DIV> </DIV>
<DIV>uses<BR>{$IFDEF WINDOWS} Windows, {$ENDIF}<BR> SysUtils, Classes,
DateUtils;</DIV>
<DIV> </DIV>
<DIV>{$IFDEF WINDOWS} {$R test4.rc} {$ENDIF}</DIV>
<DIV> </DIV>
<DIV>function cvt1 (t: TdateTime): string;<BR>var yy,mm,dd,hh,nn,ss,ms:
Word;<BR>begin<BR> DecodeDateTime (t,yy,mm,dd,hh,nn,ss,ms);<BR>
result := Format('%d %d %d %d %d %d %d',[yy,mm,dd,hh,nn,ss,ms]); //
<<<<< Bus error or misaligned data access ????<BR>end;</DIV>
<DIV> </DIV>
<DIV>function cvt2 (t: TdateTime): string;<BR>var yy,mm,dd,hh,nn,ss,ms:
Word;<BR>begin<BR> DecodeDateTime (t,yy,mm,dd,hh,nn,ss,ms);<BR>
try<BR> result := Format('%d %d %d %d %d %d
%d',[yy,mm,dd,hh,nn,ss,ms]); // OK, no Bus Error <BR>
except<BR> on E: Exception do writeln ('cvt2 ERROR ' +
E.Message);<BR> end;<BR>end;</DIV>
<DIV> </DIV>
<DIV><BR>begin<BR> try<BR> writeln ('cvt1: Now = ' +
cvt1(Now));<BR> except<BR> on E: Exception do writeln
('cvt1 ERROR ' + E.Message);<BR> end;</DIV>
<DIV> </DIV>
<DIV> writeln ('cvt2: Now = ' + cvt2(Now));<BR>end.</DIV>
<DIV> </DIV>
<DIV>and download to ARM (Advantech UNO-1019, WinCE 5.0) the output from program
is:</DIV>
<DIV> </DIV>
<DIV> cvt1 ERROR Bus error or misaligned data access<BR> cvt2: Now =
2009 9 14 12 55 31 0</DIV>
<DIV> </DIV>
<DIV><BR>Crosscompiling with 2.2.4
Lazarus-0.9.29-21694-fpc-2.2.4-20090914-win32.exe
and<BR>Lazarus-0.9.29-21694-fpc-2.2.4-20090914-cross-arm-wince-win32.exe is
OK:</DIV>
<DIV> </DIV>
<DIV> cvt1: Now = 2009 9 14 13 20 11 0<BR> cvt2: Now = 2009 9 14 13
20 11 0</DIV>
<DIV> </DIV>
<DIV><BR>Is this Bus error a compiler bug or something else ?</DIV>
<DIV> </DIV>
<DIV>Regards .</DIV>
<DIV> </DIV>
<DIV>Bogdan</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BODY></HTML>