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

Re: svn commit: r18144 - in trunk/subversion/libsvn_fs_base: . bdb

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2006-01-22 20:09:09 CET

On Sun, Jan 22, 2006 at 07:39:47PM +0100, Branko Čibej wrote:
> Malcolm Rowe wrote:
> >You'd defined bdb_cache_state as 'volatile void *', and so you're passing
> >a 'volatile void **' to apr_atomic_casptr(), for which the default
> >(macro) implementation of casts its first argument to (apr_uint32_t *)
> >- see include/apr_atomic.h:285. Isn't that a type-punned pointer?
> >
> The prototype for apr_atomic_casptr says that the first parameter is
> volatile void **. If there's a macro doing a cast getting in between,
> then that's a bug in APR and should be reported there.
>

Sorry, I should have been clearer. The default macro implementation of
apr_atomic_casptr (used on everything but Windows and Netware, it seems)
is implemented in terms of apr_atomic_cas, which _does_ take an
apr_uint32_t *:

#define apr_atomic_casptr(mem, with, cmp) \
    (void *)apr_atomic_cas((apr_uint32_t *)(mem), (long)(with), (long)cmp)

So it might be correct, but I guess it's still a type-punned pointer.

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Jan 22 20:10:17 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.