[M3devel] Modula-3 bitfields

Jay K jay.krell at cornell.edu
Sat Aug 25 22:20:56 CEST 2012


Microsoft C and gcc have a variety of ways to control this stuff. 
  command line for the entire compilation   
  #pragma pack/push/pop for a run of code   
  __declspec(align) on individual types  
  __unaligned on individual fields   
  various __attribute__ probably on types and fields  
 

Which brings me back to ...array of bytes, very clear, very portable... 

If you need compactness but not exact layout, C and Modula-3 do fine.
If you need a portable predictable layout, other than an array of bytes, they both largely fail.


 - Jay


From: dragisha at m3w.org
Date: Sat, 25 Aug 2012 22:08:46 +0200
To: microcode at zoho.com
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] Modula-3 bitfields

Systems Programming with Modula 3Edited by Greg Nelson
Modula-3 bible. Most of material is available online in various SRC reports (now on HP's ftp servers)

--Divided by a common language
Dragiša Durićdragisha at m3w.org



On Aug 25, 2012, at 9:13 PM, microcode at zoho.com wrote:On Fri, Aug 24, 2012 at 11:10:35AM -0700, Mika Nystrom wrote:
The Green Book doesn't actually define alignment rules does it?

Sorry, what's the Green Book? I just received a copy of Modula-3 by Harbison
but it's white and grimy (looks like it was a garage copy!)



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


More information about the M3devel mailing list