Re: Re: Python compiler warns about use of 0xffffffff

"Roger Binns" <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <004b01c64d81$a56f1bc0$3501a8c0@rogersqyvr14d3>
> It looks like com_lgpm225.py simply needs an out-of-range value, for
> which -1 (the current effective value on 32-bit systems AIUI) or
> sys.maxint would work just as well -- or am I missing something?  

Yes you are.  As I explained in my previous mail, the field that
it is comparing against is generated using some math elsewhere
(in particular a piece of code that takes bytes off the cable).
Whichever way Python decides decides to mutilate that (conversion
to long, conversion to signed) is exactly what it will do to
the constant value in the expression.  In Python 2.4 it will
convert both to longs and the numbers will remain positive.
In Python 2.3 it may keep them as positive or make them negative,
but it will do the same thing to both.

> for com_sanyo.py, it's not clear to me whether the value should be -1

It should never be -1.  This is an unsigned number.

> The warnings come from compileall.py, which runs on installation per
> Debian's Python policy.  I should be able to arrange to run that with
> -Wignore, though.

That will work.  This is one of those cases where the warnings are
wrong.

Roger


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.