Subject: Re: dlopen() related compiler warning
To: None <current-users@NetBSD.ORG>
From: Jaromir Dolecek <dolecek@ics.muni.cz>
List: current-users
Date: 01/11/1998 17:15:48
Hi,
Here is my problem:
Guido van Rossum wrote:
> Jaromir Dolecek wrote:
> > While compiling Python/importdl.c (Python 1.5) on NetBSD/i386,
> > compiler complains:
> >
> > ./importdl.c: In function `_PyImport_LoadDynamicModule':
> > ./importdl.c:374: warning: assignment makes pointer from integer without a cast
> >
> > it's due dlopen() not being previously defined, because <dlfcn.h>
> > is never included. Here is a patch:
> >
> >
> > --- Python/importdl.h.orig Sun Jan 11 12:50:33 1998
> > +++ Python/importdl.h Sun Jan 11 12:51:43 1998
> > @@ -29,6 +29,10 @@
> >
> > ******************************************************************/
> >
> > +#ifdef HAVE_DLFCN_H
> > +#include <dlfcn.h> /* definitions of dl* functions */
> > +#endif
> > +
> > /* Definitions for dynamic loading of extension modules */
> > enum filetype {
> > SEARCH_ERROR,
>
> But that's the wrong patch. If you look at importdl.c, you see that
> it already includes dlfcn.h, *except* for NetBSD. In particular, the
> code says:
>
> #if defined(__NetBSD__)
> #include <nlist.h>
> #include <link.h>
> #else
> #ifdef HAVE_DLFCN_H
> #include <dlfcn.h>
> #endif
> #endif
>
> I did not provide this code; I don't have NetBSD. Could someone who
> is familiar with NetBSD please provide a solution?
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)
>
So - is that NetBSD hack really mandatory or is it a misunderstanding ?
For NetBSD 1.3 I'm using now it's definitely not needed; but for
some older version it maybe should be ? According to RCDid, <nlist.h>
was touched 1996/10/01 by cgd last time, <link.h> 1997/01/03 by
scottr and <dlfcn.h> day before by pk.
What I'm especially suspicious about is, that <dlfcn.h> isn't included
on NetBSD even if it was found by configure. Seems as if <dlfcn.h>
was broken before 1.3.
Can anyone bring light into this issue ?
jd
--
Jaromir Dolecek <dolecek@ics.muni.cz> http://www.ics.muni.cz/~dolecek/
-------------------------------------------------------------------------
It is better never to have been born. But who among us has such luck?
One in a million, perhaps.