I
Ivan78
Hello All,
i have a problem with C language.
in any case when i try access to memory address the OS display a
following message:
unligned access
to resolve this problem i changed following instruction:
tpbyteSrcPos = pstSrcRec;
tpbyteDestPos = pstDestRec;
ENDIAN_RtxHostSrcToDest( (HOST_RTX_STR*)tpbyteSrcPos,
(HOST_RTX_STR*)tpbyy
teDestPos );
into:
tpbyteSrcPos = pstSrcRec;
tpbyteDestPos = pstDestRec;
memcpy(&TempSrcHostRtx, tpbyteSrcPos, sizeof(TempSrcHostRtx));
memcpy(&TempDestHostRtx, tpbyteDestPos,
sizeof(TempDestHostRtx));
ENDIAN_RtxHostSrcToDest( &TempSrcHostRtx, &TempDestHostRtx );
memcpy(tpbyteDestPos, &TempDestHostRtx,
sizeof(TempDestHostRtx));
somebody kown because i have an unaligned access??
somebody know why do i resolve this problem when i use memcpy function?
can I resolve this problem without changed first version of the code??
sorry for my English
thanks
Ivan
i have a problem with C language.
in any case when i try access to memory address the OS display a
following message:
unligned access
to resolve this problem i changed following instruction:
tpbyteSrcPos = pstSrcRec;
tpbyteDestPos = pstDestRec;
ENDIAN_RtxHostSrcToDest( (HOST_RTX_STR*)tpbyteSrcPos,
(HOST_RTX_STR*)tpbyy
teDestPos );
into:
tpbyteSrcPos = pstSrcRec;
tpbyteDestPos = pstDestRec;
memcpy(&TempSrcHostRtx, tpbyteSrcPos, sizeof(TempSrcHostRtx));
memcpy(&TempDestHostRtx, tpbyteDestPos,
sizeof(TempDestHostRtx));
ENDIAN_RtxHostSrcToDest( &TempSrcHostRtx, &TempDestHostRtx );
memcpy(tpbyteDestPos, &TempDestHostRtx,
sizeof(TempDestHostRtx));
somebody kown because i have an unaligned access??
somebody know why do i resolve this problem when i use memcpy function?
can I resolve this problem without changed first version of the code??
sorry for my English
thanks
Ivan