[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: less mixing of object and function pointers

From: Peter O'Gorman
Subject: Re: less mixing of object and function pointers
Date: Wed, 30 Aug 2006 07:17:20 +0900

On Aug 30, 2006, at 5:08 AM, Eric Blake wrote:

Hi Ralf,

From: Ralf Wildenhues
This rather mechanical patch fixes one half of the issue of mixing
pointers to data and pointers to functions, by changing the set of
callback functions to using two pointers to void and one pointer to
a function type (since we only need one function signature, there
is no problem with just using that; otherwise, we could still cast
between different function types).

Since we now have even more unused arguments, I decided to add a macro
LT__UNUSED to make GCC emit less warnings, and used that throughout

OK to apply?  Tested on GNU/Linux, where libltdl now passes
  make CFLAGS='-W -Wall -Werror'

for me.  (But I'm fixing this now only because it will make my next
bugfix easier.)

Looks good to me.  I suppose an alternative would have been
declaring a union of an object and function pointer, and using that
union as the parameter in the callbacks, to avoid the number of
unused parameters, but I think your approach is a little cleaner.

I think it is okay also, however, doesn't it require a documentation update too? (not that I've checked, it just seems likely). :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]