[Cython] a problem with sizeof() return type
Dag Sverre Seljebotn
dagss at student.matnat.uio.no
Wed Feb 4 15:37:13 CET 2009
Lisandro Dalcin wrote:
> Well, then how should we fix the return type in the code below ? (at
> Cython/Compiler/ExprNodes.py)
>
> class SizeofNode(ExprNode):
> # Abstract base class for sizeof(x) expression nodes.
>
> type = PyrexTypes.c_int_type
>
>
> I still think that the only sane way to fix that is to make Cython
> understand 'size_t' as a already defined C type. That would let us to
> properly define the return type of sizeof. Furthermore, that would let
> users to forget about having to typedef ssize_t to something.
>
> There are strong objections for my approach? What could be the
> potential problems?
The objections as I understand them is that not all C compilers
understand the "size_t" type. Not all projects (amongst them CPython)
adhere to the latest C standards.
--
Dag Sverre
More information about the Cython-dev
mailing list