On 24 January 2014 07:16, Hans Petter Selasky <h...@bitfrost.no> wrote:
> On 01/24/14 16:11, Adrian Chadd wrote:
>>
>> ... How's that matter?
>>
>> Adrian
>
>
> Ok, read slowly:
>
> uint32_t x = 255U;
> uint8_t y;
>
> On Big endian:
>
> memcpy(&y, &x, 1);
>
> y == 0;
>
> On Little endian:
>
> memcpy(&y, &x, 1);
>
> y == 255;
>
> If I'm not mistaken. The code is wrong because result depends on endianness
> :-)

Right. But that has nothing to do with the memory copy operation. That
has to do with how its stored.

So again - how's memmove() not portable here? :)


-a
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to