[Pyrex] unsigned integers bug

Josiah Carlson jcarlson at uci.edu
Wed Oct 19 21:58:49 CEST 2005


Josiah Carlson <jcarlson at uci.edu> wrote:
> 
> 
> Rainer Deyke <rainerd at eldwood.com> wrote:
> > I am trying to wrap a struct that contains a member of type 'unsigned'. 
> >   When I try to assign a value of 0xff000000 to this member, I get a 
> > Python exception: "OverflowError: long int too large to convert to int".
> > 
> > In trying to write a workaround, I discovered another bug: Pyrex doesn't 
> > understand long literals.  A literal of 0x100000000 was clipped to 0 by 
> > the C compiler, and a literal of 0x100000000 was rejected by Pyrex.
> 
> Try:
>     0x100000000L
> and/or:
>     0xff000000UL
> 
> That works for me in both GCC and MSVC 6 (I think it is standard C
> syntax for long integers).

(sorry for the second email on the subject, I've been emailing too much
today)

... And unsigned integers, etc.  I've also had no problems not including
the 'L' on plain unsigned integers...

 - Josiah




More information about the Pyrex mailing list