Path: utzoo!dciem!array!colin From: colin@array.UUCP (Colin Plumb) Newsgroups: comp.lang.c Subject: Re: Operations on pointers to void. Message-ID: <482@array.UUCP> Date: 11 Aug 90 00:16:23 GMT References: <1990Aug9.231614.5196@basho.uucp> <1990Aug10.165644.9238@zoo.toronto.edu> Organization: Array Systems Computing, Inc., Toronto, Ontario, CANADA Lines: 17 In article <1990Aug10.165644.9238@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: > Subscripting *is* pointer arithmetic. Apart from passing them around and > comparing them to each other and to NULL, there is *nothing* you can do > with `void *'s except convert them to another kind of pointer. No > dereferencing, no arithmetic. They are containers for other kinds of > pointers, not pointers themselves. Exactly. A void * can be assigned, passed, returned, and compared. Period. > Many compilers, especially old ones with `void *' hastily kludged in, > treat `void *' much like `char *'. That is a compiler bug. Actually, gcc documents its permission of pointer arithmetic on void * as a feature. I disagree. Certainly -ansi -pedantic should complain about the extension. -- -Colin