[Pyrex] Need help with pyrex compilation success but gcc failure

Jim Kaubisch jimkaubisch at yahoo.com
Wed May 2 21:42:51 UTC 2007


Hi,

I'm hoping this is a silly beginner's mistake issue, but at this point
I need help! pyrex compilation succeeds, but gcc chokes 

thanks
Jim

The C library I'm using is based around creating, filling and executing
a "transaction object". When you create an object, a pointer to the
object is returned to you. When you add transactions to the object, and
ultimately execute those transactions, you pass that pointer back to
the relevant routines. At no time do you actually manipulate the object
yourself, so passing it back and forth to Python seems safe.

Below is what I have defined and the result of trying to build

u8, u32 and intptr_t is the definition of unsigned byte, unsigned 32bit
int and pointer from <stdint.h>

#typedef struct XACT_ 	*XACT;	// Pointer to Transaction object.
	ctypedef struct XACT_
	ctypedef XACT_ *XACT

# cdef extern XACT S26_SchedOpen ( HBD hbd, u32 retries )
def s26_SchedOpen (hbd, retries):
	cdef intptr_t xACT_ptr
	cdef XACT xACT
	
	xACT= S26_SchedOpen (hbd, retries)
	xACT_ptr = <intptr_t>xACT
	return xACT_ptr

# cdef extern GWERR S26_SchedExecute 
#           ( XACT x, u32 msec, u8 *IomStatus )
def s26_SchedExecute (xact_ptr_val, msec):
	cdef u8 stats[16]
	cdef XACT xACT
	cdef intptr_t xACT_ptr
	cdef GWERR err
	
	xACT_ptr = xact_ptr_val
	xACT = <XACT> xACT_ptr
	err= S26_SchedExecute (xACT, msec, stats)
	Stat_Table = []
	for i from 0 <= i < 16:
		Stat_Table.append (stats[i])
	return err, Stat_Table

The following is the result of trying to build this...

python setup.py build_ext --inplace
running build_ext
building 'Sens121' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fPIC
-I/usr/include/python2.4 -c Sens121.c -o
build/temp.linux-x86_64-2.4/Sens121.o
Sens121.c: In function ‘__pyx_f_7Sens121_s26_SchedExecute’:
Sens121.c:685: warning: implicit declaration of function ‘XACT_’
Sens121.c:685: error: expected expression before ‘)’ token
Sens121.c:685: warning: assignment makes pointer from integer without a
cast
error: command 'gcc' failed with exit status 1


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Pyrex mailing list