home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12445 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  2.1 KB

  1. Path: sparky!uunet!oracle!unrepliable!bounce
  2. Newsgroups: comp.lang.c
  3. From: wkaufman@us.oracle.com (William Kaufman)
  4. Subject: Re: I wish ANSI-C sizeof (void) == 1 (was Re: preprocessing subterfuge)
  5. Message-ID: <1992Aug15.042533.24398@oracle.us.oracle.com>
  6. Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
  7. Nntp-Posting-Host: hqsun2.us.oracle.com
  8. Organization: Oracle Corporation, Redwood Shores CA
  9. References: <1992Aug10.031337.4424@druid.uucp> <1992Aug11.202135.28878@ugle.unit.no> <BswME5.6Mp@research.canon.oz.au>
  10. Date: Sat, 15 Aug 1992 04:25:33 GMT
  11. X-Disclaimer: This message was written by an unauthenticated user
  12.               at Oracle Corporation.  The opinions expressed are those
  13.               of the user and not necessarily those of Oracle.
  14. Lines: 29
  15.  
  16. In article <BswME5.6Mp@research.canon.oz.au> greyham@research.canon.oz.au (Graham Stoney) writes:
  17. ] When I first heard of GNU C's deviation from the standard with the sizeof type
  18. ] 'void', I thought it was a bad idea; but now I hope ANSI will standardise it
  19. ] next time around. void * is the natural type to use when you're considering a
  20. ] pointer to a chunk of memory that can hold any arbitrary type;
  21.  
  22.     Yes, that's the problem: it's a chunk of memory, not necessarily a
  23. chunk of char's.  Even though sizeof(char) may be 1 by definition, that
  24. doesn't mean it's a natural unit of memory on every machine.  As chips
  25. come along with more bits-per-computation, a pointer to a char may
  26. become useless (and inefficient) outside the context of a character
  27. string.
  28.  
  29. ] kernel for instance it seems a natural replacement for caddr_t. And any time
  30. ] I need to do arithmetic on one, it's always in terms of bytes
  31.  
  32.     Sorry to start the byte fight again, but the meaning of a byte is
  33. very tenuous, and can't be the basis for a universal pointer, as "void
  34. *" is meant to be.
  35.  
  36.     To paraphrase someone (Ritchie?), if you want a pointer to char, you
  37. know where to find it.
  38.  
  39.                                            -- Bill K.
  40.  
  41. Bill Kaufman,          | "Hush my darling / Be still my darling /
  42. Corporate Lackey       |  The lion's on the phone,..."
  43. wkaufman@us.oracle.com |              -- "The Guitar", They Might Be Giants
  44.