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 Kumfert
Subject: Re: lt_dlopenadvise() inconsistencies in libtool-2.2.2
Date: Tue, 22 Apr 2008 10:18:36 -0700 (PDT)



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?").
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.

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

Thanks,

Gary




reply via email to

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