[erlang-questions] idea: endianess in interoperability tutorials

Samuel Rivas <>
Fri Dec 14 13:10:08 CET 2007


Hi,

Interoperability tutorials examples use non-portable code to read message length
with erl_interface. For example:


  len = (buf[0] << 8) | buf[1];

works only on little-endian platforms.

I suggest a minor patch that make them a bit more portable. It might be good
idea to apply it in the documentation, I have found the original code copy-pasted in
several places (luckily running on x86 computers).

Regards
-- 
	Samuel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erl_comm.patch
Type: text/x-diff
Size: 658 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071214/f2c91044/attachment.bin>


More information about the erlang-questions mailing list