home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19369 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.3 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!mccall
  2. From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Exact-sized types (was Re: Typedefing builtin... thanks.)
  5. Message-ID: <1993Jan7.165830.28750@mksol.dseg.ti.com>
  6. Date: 7 Jan 93 16:58:30 GMT
  7. References: <1992Nov30.204147.7955@cimage.com> <84931@ut-emx.uucp> <F9I0BER@math.fu-berlin.de>
  8. Organization: Texas Instruments Inc
  9. Lines: 30
  10.  
  11. In <F9I0BER@math.fu-berlin.de> rene@hamel.uucp (Rene Mueller) writes:
  12.  
  13. >In article <84931@ut-emx.uucp>, jamshid@ut-emx.uucp (Jamshid Afshar) writes:
  14. >|> In article <1992Nov30.204147.7955@cimage.com> ejd@cimage.com (Ed Driscoll) writes:
  15. >|> |The typedefs I proposed
  16. >|> |would all specify size in bits, either exactly or at least that many bits.
  17. >|> |Using your example, there might be an at-least-18-bits type and an
  18. >|> |exactly-18-bits type (both with variations for signed and unsigned, I 
  19. >|> |suppose).  So there'd be no way to get confused about how many bits you
  20. >|> |were getting unless the typedefs themselves were incorrect.
  21. >|> 
  22. >|> I don't understand the purpose of the "at-least-N-bits" types.  C
  23. >|> already has those -- char (>=8), short (>=16), int (>=16), and long
  24. >|> (>=32).  What does your extra level of indirection buy you?
  25. >You are'nt correct:
  26. >int is as long as a single machine word on the machine (on some machines this means 12bit), on this machines also a short is 12bit long and a long is 24bits long...
  27. >The same is with characters
  28. >Some compilers will give you only the original ASCII-Characterset and a char-value with this machines is 7bit long, all other bits stored in memory for this value will be ignored...
  29.  
  30. The behaviour you describe is not allowed in an ANSI compiler, which
  31. must provide the minimum sizes that Ed describes.
  32.  
  33. [Please hit return every 72 characters or so -- it makes things like
  34. inclusions and following the attributions much easier.]
  35.  
  36. -- 
  37. "Insisting on perfect safety is for people who don't have the balls to live
  38.  in the real world."   -- Mary Shafer, NASA Ames Dryden
  39. ------------------------------------------------------------------------------
  40. Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
  41.