[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] fix for issue #591

From: Albert Chin <subversion-dev_at_thewrittenword.comt>
Date: 2002-01-20 22:28:44 CET

On Sun, Jan 20, 2002 at 03:27:36PM -0500, Garrett Rooney wrote:
> On Sun, Jan 20, 2002 at 07:23:25PM +0000, Philip Martin wrote:
> > Garrett Rooney <rooneg@electricjellyfish.net> writes:
> >
> > > > > + apr_hash_this(hi, (const void **)&key, NULL, (void **)&val);
> > > >
> > > > Existing code generally avoids the casts and declares
> > > >
> > > > const void *key;
> > > > apr_ssize_t klen;
> > > > void *val;
> > > > apr_hash_this (hi, &key, &klen, &val);
> > >
> > > wouldn't i just have to cast it later when i use them?
> >
> > In this case I don't think so, they simply get passed to functions
> > that take a pointer.
>
> i gave it a shot, and switching to const void *key and void *val in
> libsvn_ra_dav/fetch.c simply results in warnings from gcc about using
> void * in arithmetic and dereferencing void pointers. plus, it
> appears that the rest of the file uses apr_hash_this in the same way i
> was originally using it (with the casts).

I don't think all non-GCC compilers will allow arithmetic on void
pointers. I think AIX xlc, in particular, will fail. If it is not
portable, please avoid.

-- 
albert chin (china@thewrittenword.com)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:57 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.