apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: optional function pointer casts to/from (void *)
Date Thu, 16 Sep 2004 08:22:42 GMT
On Mon, Sep 13, 2004 at 05:18:40PM -0400, Joe Schaefer wrote:
> This may be a bit pedantic, but I was looking over
> the optional function implementation in apr_hooks.c
> and noticed a few casts between void * and (void)(*)(void).
> Technically this isn't legal in C, because the specs
> don't guarantee that function pointers are "compatible"
> (read: same size) with data pointers like (void *).
> 
> It should be easy enough to correct this by introducing
> a private dummy wrapper struct like
> 
>   struct apr_dynamic_fn_ptr {
>     (void)(*function)(void);
>   }

You're talking about the pointers stored in the s_phOptionalFunctions
hash?  It would make sense to do that there, I think, yes please!

joe

Mime
View raw message