apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davi Arnaut <d...@apache.org>
Subject Re: svn commit: r589846 - /apr/apr/trunk/file_io/unix/fullrw.c
Date Tue, 30 Oct 2007 12:29:02 GMT
Lucian Adrian Grijincu wrote:
> On 10/30/07, jean-frederic clere <jfclere@gmail.com> wrote:
>> trawick@apache.org 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

Mime
View raw message