[M3devel] packing problem… how exactly does modula-3 pack data into records??

Dragiša Durić dragisha at m3w.org
Fri Jan 20 08:29:47 CET 2012


I am not using packing to interface with C or to be compact.

My code is directly producing packets for some network protocol. No C in sight :). 

And, as probably all those pesky :) network protocols around… Order of bytes and (expected) order of bits is - left to right.

I really do not understand why this is something hard to accept as standard (or at least cm3) way for  bit packing?

On Jan 20, 2012, at 2:18 AM, Jay K wrote:

> Anyway, if you just conserving space, then "BITS FOR" should work fine.
> If you need to interface with C, and you can't change the C, you should be able to get something to work, but it will possibly be somewhat non-portable, esp. endian-specific.
> I think besides endianness, there is another factor, where cm3 tries to be C-compatible.
> Like, how aligned bitfields need to be.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120120/5ce7c8a4/attachment-0002.html>


More information about the M3devel mailing list