FutureWarning question

Mike mike at nospam.com
Tue Apr 13 01:39:44 EDT 2004


I ran across the message below in 2.3.2 today. These are the lines of code:

   402: if m1_hi >> 15 & 0x0001 == 1:
   403:    m1_hi = m1_hi | 0xFFFF0000
   404: if m1_lo >> 15 & 0x0001 == 1:
   405:    m1_lo = m1_lo | 0xFFFF0000

This is the warning message:

   pwg.py:403: FutureWarning: hex/oct constants > sys.maxint will return 
   positive values in Python 2.4 and up
      m1_hi = m1_hi | 0xFFFF0000
   pwg.py:405: FutureWarning: hex/oct constants > sys.maxint will return 
   positive values in Python 2.4 and up
      m1_lo = m1_lo | 0xFFFF0000

m1_hi and m1_lo are 32 bit values read from a file. It's not clear to me
what the warning message means. The only constant is 0xffff0000; does the
message mean that the result of the OR operation won't be what I think it
is? Can anyone elucidate?

Thanks,

-- Mike --



More information about the Python-list mailing list