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,280 of 243,242   
   David Brown to Keith Thompson   
   Re: _BitInt(N)   
   01 Dec 25 08:36:25   
   
   From: david.brown@hesbynett.no   
      
   On 01/12/2025 02:32, Keith Thompson wrote:   
   > Michael S  writes:   
   > [...]   
   >> Now, if you ask me, I don't understand why Waldek Hebisch considers   
   >> difference between 8-bit and [byte-addressable] 16-bit targets   
   >> important. As far as size of relevant C types goes, they look the same:   
   >> char - 8 bits   
   >> int - 16 bit   
   >> long - 32 bits   
   >> There is possibly difference in the size of 'short', but I don't   
   >> understand why it matters.   
   >   
   > Given 16-bit int, short is almost certain to be 16 bits as well.   
   >   
   > char is requires to be at least 8 bits, short and int at least 16, and   
   > long at least 32 (and long long at least 64).   
   >   
   > Or is 8-bit short used in some non-conforming mode?   
   >   
      
   Some C compilers for 8-bit devices have non-conforming modes with 8-bit   
   int.  (I've seen one that, by default, had 16-bit int but did not   
   promote 8-bit types to int for arithmetic.  That caused some subtle   
   problems for us.)  I don't know if SDCC has such a mode (avr-gcc does).   
      
   Generally, "short" is not used on 8-bit targets - it's simply not a   
   useful type.   
      
   --- 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