[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Modules dlmodule.c,2.14,2.15

Thomas Wouters thomas@xs4all.net
Thu, 12 Oct 2000 01:15:21 +0200


On Wed, Oct 11, 2000 at 02:44:05PM -0700, Fred L. Drake wrote:
> Update of /cvsroot/python/python/dist/src/Modules
> In directory slayer.i.sourceforge.net:/tmp/cvs-serv20717
> 
> Modified Files:
> 	dlmodule.c 
> Log Message:
> 
> Remove one more gcc -Wall warning.

To note, if gcc didn't inherit at least *some* of C's original philosophy of
'the programmer always knows what [s]he is doing', gcc would yell bloody
murder at this code. The 'func' function pointer is used to point to symbols
loaded from arbitrary shared objects, and the dlmodule has no way of knowing
howmany arguments the function expects, or even if it isn't more than 10
(which would result in the function grabbing garbage off the stack, on most
architectures, I think.) While on the ANSIfication spree, I ran screaming
and hid under my bed after reading this code ;)

Is anyone using the dlmodule anymore ? Is it really useful ? Is this
*really* how loading and calling arbitrary shared objects should be done ? :P

>   {
>   	PyObject *name;
> ! 	long (*func)(long, long, long, long, long,
> !                      long, long, long, long, long);
>   	long alist[10];
>   	long res;

Idle-and-post-2.0-talk-ly y'rs,
-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!