Bugs item #1184380, was opened at 2005-04-16 19:36
Message generated for change (Comment added) made by lbruno
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1184380&group_id=5470

Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 1
Submitted By: bamoore (bamoore)
Assigned to: Nobody/Anonymous (nobody)
Summary: example broken in section 1.12 of Extending & Embedding

Initial Comment:
In section 1.12 of Extending and Embedding the Python
Interpreter Release 2.4, the example (spammodule) does
not compile on linux with distutils.  I get the following:
~/sandbox/python/c_api_test$ python2.4 spam-setup.py build
running build
running build_ext
building 'spam' extension
creating build
creating build/temp.linux-i686-2.4
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall
-Wstrict-prototypes -fPIC -I/usr/include/python2.4 -c
spammodule.c -o build/temp.linux-i686-2.4/spammodule.o
spammodule.c:7: error: conflicting types for
`PySpam_System'
spammodule.h:21: error: previous declaration of
`PySpam_System'
error: command 'gcc' failed with exit status 1

I think the solution is to change line 12 of the
spammodule header file listing from:

#define PySpam_System_PROTO (char *command)

to:

#define PySpam_System_PROTO (const char *command)

as that seems to compile for me.  (though not tested
from another C extension).

----------------------------------------------------------------------

Comment By: Luis Bruno (lbruno)
Date: 2005-04-21 14:05

Message:
Logged In: YES 
user_id=1263795

AIUI, your solution is correct; a cursory glance through the
PyArg_ParseTuple() documentation and the system() manual
page leads me to believe we're expecting a const char *.

I'll submit a patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1184380&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to