home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19320 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.6 KB  |  30 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!math.fu-berlin.de!hamel!rene
  3. From: rene@hamel.uucp (Rene Mueller)
  4. Subject: Re: Exact-sized types (was Re: Typedefing builtin... thanks.)
  5. Message-ID: <F9I0BER@math.fu-berlin.de>
  6. Sender: rene@hamel (Rene Mueller)
  7. Organization: Free University of Berlin, Germany
  8. References: <1992Nov30.204147.7955@cimage.com> <84931@ut-emx.uucp>
  9. Date: Wed, 6 Jan 1993 18:50:43 GMT
  10. Lines: 18
  11.  
  12. In article <84931@ut-emx.uucp>, jamshid@ut-emx.uucp (Jamshid Afshar) writes:
  13. |> In article <1992Nov30.204147.7955@cimage.com> ejd@cimage.com (Ed Driscoll) writes:
  14. |> |The typedefs I proposed
  15. |> |would all specify size in bits, either exactly or at least that many bits.
  16. |> |Using your example, there might be an at-least-18-bits type and an
  17. |> |exactly-18-bits type (both with variations for signed and unsigned, I 
  18. |> |suppose).  So there'd be no way to get confused about how many bits you
  19. |> |were getting unless the typedefs themselves were incorrect.
  20. |> 
  21. |> I don't understand the purpose of the "at-least-N-bits" types.  C
  22. |> already has those -- char (>=8), short (>=16), int (>=16), and long
  23. |> (>=32).  What does your extra level of indirection buy you?
  24. You are'nt correct:
  25. 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...
  26. The same is with characters
  27. 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...
  28.  
  29.     rene@math.fu-berlin.de
  30.