Lucian Adrian Grijincu wrote: > On 10/30/07, jean-frederic clere <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> Author: trawick >>> Date: Mon Oct 29 13:36:08 2007 >>> New Revision: 589846 >>> >>> URL: http://svn.apache.org/viewvc?rev=589846&view=rev >>> Log: >>> AIX C compiler won't add to void * in picky mode >> It seems I also had problems on HP-UX: >> +++ >> if (amt) { >> <<<<<<< .mine >> /* rv = apr_file_write_full(thefile, vec[i].iov_base + amt, */ >> void *ptr = vec[i].iov_base; >> ptr = ptr + amt; >> rv = apr_file_write_full(thefile, ptr, >> ======= > > > does the C standard allow void* arithmetics? >
No, it's a handy GNU extension. Arithmetic cannot be performed on void pointers because the void type has no size. GCC can issue warnings such for such: -Wpointer-arith Warn about anything that depends on the ``size of'' a function type or of "void". GNU C assigns these types a size of 1, for convenience in calculations with "void *" pointers and pointers to functions. -- Davi Arnaut
