[ python-Bugs-1184380 ] example broken in section 1.12 of Extending & Embedding

SourceForge.net noreply at sourceforge.net
Sat Apr 16 21:36:25 CEST 2005


Bugs item #1184380, was opened at 2005-04-16 14:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
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: 5
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).

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1184380&group_id=5470


More information about the Python-bugs-list mailing list