home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,172 of 243,242   
   James Kuyper to Michael S   
   Re: _BitInt(N)   
   26 Nov 25 21:19:14   
   
   From: jameskuyper@alumni.caltech.edu   
      
   On 2025-11-26 04:29, Michael S wrote:   
   > On Tue, 25 Nov 2025 18:33:30 +0000   
   > bart  wrote:   
   ...   
   >> Then maybe C bitfields could be used, but a bigger problem with those   
   >> is poor control over layout, which is anyway implementation-defined.   
   >> (Mine of course don't have that problem!)   
   >   
   > According to the language of The Standard, it's not 'poor control'.   
   > As far as standard requirements goes, there is *no* control on layout of   
   > bit fields.   
      
   C ;doesn't provide enough control over bit-field layouts to be useful,   
   but it's an exaggeration to say it provides no control at all:   
      
   "An implementation may allocate any addressable storage unit large   
   enough to hold a bit-field. If enough space remains, a bit-field that   
   immediately follows another bit-field in a structure shall be packed   
   into adjacent bits of the same unit. If insufficient space remains,   
   whether a bit-field that does not fit is put into the next unit or   
   overlaps adjacent units is implementation-defined. The order of   
   allocation of bit-fields within a unit (high-order to low-order or   
   low-order to high-order) is implementation-defined. The alignment of the   
   addressable storage unit is unspecified.   
   A bit-field declaration with no declarator, but only a colon and a   
   width, indicates an unnamed bit-field.148) As a special case, a   
   bit-field structure member with a width of zero indicates that no   
   further bit-field is to be packed into the unit in which the previous   
   bit-field, if any, was placed."   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca