Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83 based; site hou2d.UUCP Path: utzoo!watmath!clyde!cbosgd!ulysses!mhuxr!mhuxt!houxm!hou2d!osd From: osd@hou2d.UUCP (Orlando Sotomayor-Diaz) Newsgroups: mod.std.c Subject: mod.std.c Digest V13#2 Message-ID: <854@hou2d.UUCP> Date: Fri, 17-Jan-86 08:28:44 EST Article-I.D.: hou2d.854 Posted: Fri Jan 17 08:28:44 1986 Date-Received: Sat, 18-Jan-86 01:27:42 EST Organization: AT&T Bell Labs, Holmdel NJ Lines: 67 Approved: osd@hou2d.UUCP From: Orlando Sotomayor-Diaz (The Moderator) mod.std.c Digest Fri, 17 Jan 86 Volume 13 : Issue 2 Today's Topics: Subtracting (void *) (2 msgs) type of '%' ---------------------------------------------------------------------- Date: Wed, 15 Jan 86 02:08:22 est From: ihnp4!seismo!hadron!jsdy (Joseph S. D. Yao) Subject: Subtracting (void *) To: ihnp4!hou2d!osd In my mental model, where sizeof(char) tends to be 1 and sizeof(short int) tends to be 2, I think of sizeof(void) as 0. The strict mathe- matical extension of this is that the difference between two such is undefined, or infinite. This is reasonable if you are treating a void pointer as a true pointer to nothing: the difference between two pointers to nothing must be undefined. As it is, it is interpreted as a PTR data type, or pointer to anything. Well, as such the difference appears to be still undefined. -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP} ------------------------------ Date: Thu, 16 Jan 86 20:10:14 EST From: Doug Gwyn (VLD/VMB) Subject: Subtracting (void *)s To: std-c%cbosgd.uucp@brl-vgr.arpa My interpretation is that a (void *) does not point at anything (not even a 0-sized "thing"), and therefore you are not allowed to perform arithmetic on it. The only thing it's good for is as a generic holder for pointers of any type. [ I'd suggest to state this explicitly on the standard. - Mod - ] ------------------------------ Date: Tue, 14 Jan 86 09:53:22 est From: cbnap!whp Subject: type of '%' To: cbosgd!std-c >from Arnold Robbins >... >The constant '%' is of type char, ... Maybe in the draft it says its of type char, but on existing implementations the type of '%' is int (according to AT&T C language definition as of April '84; the C reference manual in the back of K&R doesn't say what the type is). Certainly The type can't be char on any machine with a larger word size, since constants such as 'ab' (or even 'abcd' on some machines) are allowed. (Perhaps the draft doesn't mention multi-character constants since they're inherently non-portable.) ------------------------------ End of mod.std.c Digest - Fri, 17 Jan 86 08:19:57 EST ****************************** USENET -> posting only through cbosgd!std-c. ARPA -> ... through cbosgd!std-c@BERKELEY.ARPA (NOT to INFO-C) In all cases, you may also reply to the author(s) above.