bug-libtool
[Top][All Lists]
Advanced

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

Re: lt_dlopenadvise() inconsistencies in libtool-2.2.2


From: Gary V. Vaughan
Subject: Re: lt_dlopenadvise() inconsistencies in libtool-2.2.2
Date: Tue, 22 Apr 2008 18:32:24 -0400

Hi Gary,

On 22 Apr 2008, at 13:18, Gary Kumfert wrote:
On Sun, 20 Apr 2008, Bob Friesenhahn wrote:
On Sun, 20 Apr 2008, Gary V. Vaughan wrote:

I agree that this was arguably not the best decision, and maybe once we've branched the tree for 2.2 maintenance we should consider putting the struct in a public header along with a warning that it should not be accessed to give the compiler the best chance to catch these kinds of errors in future.

It is possible to "forward declare" a C structure without providing info about its content. Not as nice as C++ but still good enough for the C compiler to issue useful diagnostics.

IMHO I tend to agree with Bob here.  Also, judicious use of
const-ness can force the "read only" characteristic you intend
without complicating the API for the programmer ("do I put an
ampersand here or not?").

I'm am leary of overuse of const, as it tends to leak out and infect everything, and also always results in ending up with (once again) pointless casting to get rid of it somewhere in the call stack (probably inside the API boundary, but ugly none-the-less).

The reasoning I'm trying to stick with here is, if this call might change the parameter I'm passing then use an ampersand, otherwise don't.

Alternatively, for the void* and casting approach, adding and
testing for a cookie (some secret, fixed value embedded in the
struct) would catch most cases where the wrong pointer
is passed in.

Most definitely a nicer solution overall, but I didn't want to introduce inconsistency in the way libltdl treats opaque types. Maybe this is something we can evaluate for the next rould of development after 2.2 has branched off?

In any case.  Your time an attention in my earlier bug
report is most appreciated.


Not at all. Thanks for taking the time to report bugs where we can try to fix them!

Cheers,
        Gary
--
  ())_.              Email me: address@hidden
  ( '/           Read my blog: http://blog.azazil.net
  / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_




Attachment: PGP.sig
Description: This is a digitally signed message part


reply via email to

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