Re: Python compiler warns about use of 0xffffffff

[email protected] (Aaron M. Ucko)
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <[email protected]>
"Roger Binns" <[email protected]> writes:

> The math that is done to produce the numbers being compared is
> done in the default integer type.  These comparisons need to
> happen in the same type.  ie if Python does make numbers
> negative because the top bit is set then it needs to happen
> to both.  I guess I could cause all the math and all constants
> in longs, but that is a rather silly way to get get rid of
> warnings.

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?  As
for com_sanyo.py, it's not clear to me whether the value should be -1
across the board or only on 32-bit systems.

> That said the code does attempt to turn off warnings when
> run optimized.  See src/bp.py.  It also makes stdout and
> stderr be dummies that don't do anything.  So there should
> be no output at all.  (This behaviour can be changed by
> specifying 'debug' as a command line argument).

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.

Thanks for the explanation.

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
Finger [email protected] (NOT a valid e-mail address) for more info.


-------------------------------------------------------
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.