On Fri, Feb 6, 2009 at 7:59 PM, Robert Bradshaw
<[email protected]> wrote:
> On Feb 3, 2009, at 12:01 PM, Michael Abshoff wrote:
>
> I think "int" is the best thing to return--it can always get coerced
> up to a size_t if needed, but the other way may prove problematic.
> Also, "int" is a more abstract (conceptually at least) type (better
> fitting with the ambiguity in the C standard), and we shouldn't have
> to worry about overflow in this case.
>
I have to strongly disagree with you.
Try the output of this Cython code
print sizeof(char[1<<30]) * 3
versus the output of this C code:
#include "stdio.h"
int main() {
printf("%u\n", sizeof(char[1<<30])*3);
}
For the first you get -1073741824 (clearly wrong), and for the second
3221225472. (Used a 32 bit box)
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev