[Scipy-tickets] [SciPy] #407: Wrong assumption of char signedness in Numexpr

SciPy scipy-tickets@scipy....
Fri Apr 27 11:30:17 CDT 2007


#407: Wrong assumption of char signedness in Numexpr
---------------------+------------------------------------------------------
 Reporter:  ivilata  |       Owner:  somebody                          
     Type:  defect   |      Status:  new                               
 Priority:  normal   |   Milestone:                                    
Component:  Other    |     Version:                                    
 Severity:  normal   |    Keywords:  numexpr char signedness assumption
---------------------+------------------------------------------------------
 The function `op_signature()` in Numexpr's `interpreter.c` is declared as

 {{{
 static char op_signature(int op, int n)
 }}}

 However, it may return -1. Then it should be declared `signed`, since in
 some architectures like PowerPC the default `char` type is unsigned. Some
 variables where the result of `op_signature()` is put have the same
 problem. In fact, one may notice a "comparison is always true due to
 limited range of data type" warning with the current code with GCC -Wall
 under GNU/Linux in a PowerPC, for instance.

 I have attached a patch that declares everything correctly.

-- 
Ticket URL: <https://projects.scipy.org/scipy/scipy/ticket/407>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list