Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mailrus!ncar!ico!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Operations on pointers to void. Message-ID: <17443@haddock.ima.isc.com> Date: 17 Aug 90 00:47:03 GMT References: <482@array.UUCP> <1990Aug12.231202.23826@druid.uucp> <174@srchtec.UUCP> <1990Aug16.014947.1999@druid.uucp> Reply-To: karl@kelp.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 13 In article <1990Aug16.014947.1999@druid.uucp> darcy@druid.uucp (D'Arcy J.M. Cain) writes: >If the language supported pointer arithmetic on void * this would be >possible. Note that GNU C does support it and I can't see any harm in it. The potential harm is when somebody writes code like vp = (struct foo *)vp; ... ++vp ... without realizing that it doesn't do what was intended. (Somebody *did* recently post code much like this, in fact.) This type of error will be caught by the ANSI rule, which makes sense because `void' is an incomplete type of undefined size. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint