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