apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: svn commit: r330141 - /apr/apr-util/trunk/dbd/apr_dbd.c
Date Wed, 02 Nov 2005 09:03:07 GMT
On Tue, Nov 01, 2005 at 11:54:18PM +0100, André Malo wrote:
> * Nick Kew wrote:
> 
> > On Tuesday 01 November 2005 22:44, André Malo wrote:
> > > * niq@apache.org wrote:
> > > > +#define CLEANUP_CAST (apr_status_t (*)(void*))
> > >
> > > Hmm. That looks strange to me. Wouldn't a typedef (+ casts in place)
> > > serve better?
> >
> > Huh?  It is a cast.  No more, no less.
> 
> Yep. I'd do it in place anyway. The macro actually decreases readability 
> here (IMHO, of course ;-).
> 
> Further thinking, the typedef is actually missing in apr_pools.h. Not sure 
> about the policy - could this be added for the next APR version?

This code has undefined behaviour by the C standard (calling a function 
via a function pointer of incompatible type), such casts should never be 
used at all IMO.

joe

Mime
View raw message