Email List: Xaustin-group-lX
[All Lists]

Re: Return type of dlsym

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Return type of dlsym
From: Matt Seitz <yyyyyy@xxxxxxxxx>
Date: Tue, 16 Apr 2002 10:24:39 -0700 (PDT)
-- Marc Aurele La France <yyy@xxxxxxxxxxx> wrote:
> Given dlsym() is
> currently constrained to return a void *, it has no portable means
> returning to its caller any information about a symbol other than its
> existence/non-existence.  Thus, any portable dlsym() implementation
> requires that all pointers have exactly the same representation.
> > As has already been said, a resolution of this issue should be
> two-pronged.  First, the example for dlsym() should be corrected to comply
> with ISO C.  

This seems a contradiction to me.  If dlsym has no ISO C compatible means of
returning a function symbol's address, then how can one construct an example
that complies with ISO C?  Unless you mean the example should only show dlsym
used to confirm the existance of a function symbol?

> The last point I'd like to make is that 1003.1-2001 (or whatever you want
> to call it) was never meant to be a superset of ISO C.  Rather, they were
> to align with each other, where they intersect.  

This sounds a bit like Dr. Stroustrup's design philosophy for C++.  A couple of
Dr. Stroustrup's guiding principles for C++ regarding C compatability were:
-"As close to C as possible, but no closer".  
-"Avoid gratuitious incompatability with C"

In other words, C++ strives to be as compatible with C as it can, so long as it
doesn't mean sacrificing an important feature of C++.  If an important feature
requires diverging from Standard C, then C++ does so.  But if a feature can be
supported without violating Standard C, C++ follows Standard C.  I would hope
that UNIX/POSIX C would have a similar philosophy.   

If it truly important that one function be used for both object and function
pointers, then it makes sense to diverge from Standard C.  But I don't see a
huge benefit from having just one function vs. seperate data pointer and
function pointer functions.  In this case, the benefits of Standard C
compatability lead me to favor a seperate dlfsym function.

P.S.  How about naming such a function "dlsym_f"?  That way it would be next to
"dlsym" in an alphabetical listing. 


=====
Sincerely,
Matt Seitz

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

<Prev in Thread] Current Thread [Next in Thread>