[SPAM: 3.000] [Pyrex] size_t and reference passing in 64-bit platforms

Francesc Alted falted at openlc.org
Wed Jan 21 12:24:08 CET 2004


A Dimecres 21 Gener 2004 05:42, Greg Ewing va escriure:
> > I'm having problems when using the special type "size_t" and perhaps you
> > can give me a hand. What I want is to pass a size_t data type per
> > reference to a C function
>
> Pyrex doesn't handle this very well at the moment. You'll have to find
> out what the actual definition of size_t is on your platform and use
> that. Obviously this makes your Pyrex code platform-dependent, but
> that can't be helped. I hope to provide a better solution in some
> future version.

Well, I've done some more experiments on that, and I must tell that this
seems a problem only with some Linux. On Windows using the MSVC compiler, it
does not show any warning related with defining size_t as long. In MacOSX,
using gcc 3.1 this does not happen neither, nor does on a AMD Opteron (64
bits) running SuSe Linux (kernel version 2.4.21).

So, the only place I've seen the warnings as consequence of mapping size_t
to long is in 32-bit Linux (Debian) and any gcc version (I've test gcc-2.95,
gcc-3.1, gcc-3.2 and gcc-3.3). Maybe this is a problem with my kernel
headers (using Linux 2.4.20 here), who knows!

Anyway, as I said before, mapping size_t to long seems to generate good
binaries on every platform (be 32-bit or 64-bit), independently of the
warnings that the gcc compiler issues on certain platforms (32-bit) or
kernels (2.4.20). So, the Pyrex code continues to be platform-independent,
and this seems another kind of problem. Anyone using a different kernel than
2.4.20 could give the example a try?.

Thanks,

-- 
Francesc Alted






More information about the Pyrex mailing list