How often do you scan the full output of 'python runtests.py' in order
to look for suspicious C-code generation? I guess never ;-), as Cython
test suite generate many warning with GCC.

As this situation make me feel very uncomfortable, you have here for
review a patch touching many test cases for removing those nasty GCC
warnings. If there are no major objections, I would like to push this
ASAP.

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
diff -r 57467649c34c tests/compile/arrayptrcompat.pyx
--- a/tests/compile/arrayptrcompat.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/arrayptrcompat.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -5,8 +5,8 @@
     cdef int *p
     cdef void *v
     cdef int a[5]
-    cdef int i
-    cdef E e
+    cdef int i=0
+    cdef E e=z
     p = a
     v = a
     p = a + i
@@ -15,3 +15,5 @@
     p = e + a
     p = a - i
     p = a - e
+
+f()
diff -r 57467649c34c tests/compile/arraytoptrarg.pyx
--- a/tests/compile/arraytoptrarg.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/arraytoptrarg.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -4,3 +4,4 @@
 cdef void f2(char *argv[]):
     pass
 
+f1(NULL)
diff -r 57467649c34c tests/compile/ass2longlong.pyx
--- a/tests/compile/ass2longlong.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ass2longlong.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -6,3 +6,5 @@
     x = L
     U = x
     x = U
+
+spam()
diff -r 57467649c34c tests/compile/behnel4.pyx
--- a/tests/compile/behnel4.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/behnel4.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -2,4 +2,6 @@
     spam, eggs
 
 cdef E f() except spam:
-    pass
+    return eggs
+
+f()
diff -r 57467649c34c tests/compile/belchenko1.pyx
--- a/tests/compile/belchenko1.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/belchenko1.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -3,3 +3,5 @@
 
 cdef int _is_aligned(void *ptr):
     return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0
+
+_is_aligned(NULL)
diff -r 57467649c34c tests/compile/builtinfuncs.pyx
--- a/tests/compile/builtinfuncs.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/builtinfuncs.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -21,3 +21,5 @@
     #i = typecheck(x, y)
     #i = issubtype(x, y)
     x = abs
+
+f()
diff -r 57467649c34c tests/compile/cascmp.pyx
--- a/tests/compile/cascmp.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/cascmp.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,5 +1,5 @@
 cdef void foo():
-    cdef int bool, int1, int2, int3, int4
+    cdef int bool, int1=0, int2=0, int3=0, int4=0
     cdef object obj1, obj2, obj3, obj4
     obj1 = 1
     obj2 = 2
@@ -11,3 +11,5 @@
     bool = obj1 < 2 < 3
     bool = obj1 < 2 < 3 < 4
     bool = int1 < (int2 == int3) < int4
+
+foo()
diff -r 57467649c34c tests/compile/cassign.pyx
--- a/tests/compile/cassign.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/cassign.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,7 +1,7 @@
 cdef void foo():
-    cdef int i1, i2
-    cdef char c1, c2
-    cdef char *p1, *p2
+    cdef int i1, i2=0
+    cdef char c1=0, c2
+    cdef char *p1, *p2=NULL
     i1 = i2
     i1 = c1
     p1 = p2
@@ -9,4 +9,5 @@
     i1 = obj1
     p1 = obj1	
     p1 = "spanish inquisition"
-    
\ No newline at end of file
+
+foo()    
diff -r 57467649c34c tests/compile/casttoexttype.pyx
--- a/tests/compile/casttoexttype.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/casttoexttype.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -7,3 +7,5 @@
 cdef void blarg(void *y, object z):
     foo(<Spam>y)
     foo(<Spam>z)
+
+blarg(<void*>None, None)
diff -r 57467649c34c tests/compile/cenum.pyx
--- a/tests/compile/cenum.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/cenum.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -5,9 +5,10 @@
     g = 42
 
 cdef void eggs():
-    cdef Spam s1, s2
+    cdef Spam s1, s2=a
     cdef int i
     s1 = s2
     s1 = c
     i = s1
-    
\ No newline at end of file
+
+eggs()    
diff -r 57467649c34c tests/compile/cnumop.pyx
--- a/tests/compile/cnumop.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/cnumop.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,11 +1,13 @@
 def f():
-    cdef int int1, int2, int3
-    cdef char char1
-    cdef long long1, long2
-    cdef float float1, float2
-    cdef double double1
+    cdef int int1=0, int2=0, int3=1
+    cdef char char1=0
+    cdef long long1=0, long2=0
+    cdef float float1=0, float2=0
+    cdef double double1=0
     int1 = int2 * int3
     int1 = int2 / int3
     long1 = long2 * char1
     float1 = int1 * float2
     double1 = float1 * int2
+
+f()
diff -r 57467649c34c tests/compile/coercearraytoptr.pyx
--- a/tests/compile/coercearraytoptr.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/coercearraytoptr.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -8,3 +8,5 @@
     cdef Grail grail
     spam(silly)
     spam(grail.silly)
+
+eggs()
diff -r 57467649c34c tests/compile/coercetovoidptr.pyx
--- a/tests/compile/coercetovoidptr.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/coercetovoidptr.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,5 +1,6 @@
 cdef void f():
     cdef void *p
-    cdef char *q
+    cdef char *q=NULL
     p = q
 
+f()
diff -r 57467649c34c tests/compile/complexbasetype.pyx
--- a/tests/compile/complexbasetype.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/complexbasetype.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,4 +1,6 @@
 cdef extern (int *[42]) spam, grail, swallow
 
 cdef (int (*)()) brian():
-    pass
+    return NULL
+
+brian()
diff -r 57467649c34c tests/compile/cstructreturn.pyx
--- a/tests/compile/cstructreturn.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/cstructreturn.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -3,3 +3,5 @@
 
 cdef Foo f():
     blarg = 1 + 2
+
+f()
diff -r 57467649c34c tests/compile/cunsignedlong.pyx
--- a/tests/compile/cunsignedlong.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/cunsignedlong.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,5 +1,7 @@
 cdef void f():
     cdef unsigned long x
-    cdef object y
+    cdef object y=0
     x = y
     y = x
+
+f()
diff -r 57467649c34c tests/compile/declarations.pyx
--- a/tests/compile/declarations.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/declarations.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -12,9 +12,12 @@
 cdef extern int fnargfn(int ())
 
 cdef void f():
-    cdef void *p
+    cdef void *p=NULL
     global ifnp, cpa
     ifnp = <int (*)()>p
 
 cdef char *g():
     pass
+
+f()
+g()
diff -r 57467649c34c tests/compile/delslice.pyx
--- a/tests/compile/delslice.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/delslice.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,3 +1,5 @@
 cdef void spam():
     cdef object x
     del x[17:42]
+
+spam()
diff -r 57467649c34c tests/compile/doda1.pyx
--- a/tests/compile/doda1.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/doda1.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -9,3 +9,5 @@
 
 cdef object blarg():
     pass
+
+foo()
diff -r 57467649c34c tests/compile/emptytry.pyx
--- a/tests/compile/emptytry.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/emptytry.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -3,3 +3,5 @@
         pass
     finally:
         pass
+
+f()
diff -r 57467649c34c tests/compile/enumintcompat.pyx
--- a/tests/compile/enumintcompat.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/enumintcompat.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -5,10 +5,10 @@
     b
 
 cdef void f():
-    cdef E e
-    cdef G g
-    cdef int i, j
-    cdef float f, h
+    cdef E e=a
+    cdef G g=b
+    cdef int i, j=0
+    cdef float f, h=0
     i = j | e
     i = e | j
     i = j ^ e
@@ -23,3 +23,5 @@
     # f = j ** e # Cython prohibits this
     i = e + g
     f = h
+
+f()
diff -r 57467649c34c tests/compile/eqcmp.pyx
--- a/tests/compile/eqcmp.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/eqcmp.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,7 +1,7 @@
 cdef void foo():
-    cdef int bool, int1, int2
-    cdef float float1, float2
-    cdef char *ptr1, *ptr2
+    cdef int bool, int1=0, int2=0
+    cdef float float1=0, float2=0
+    cdef char *ptr1=NULL, *ptr2=NULL
     cdef int *ptr3
     bool = int1 == int2
     bool = int1 != int2
@@ -10,4 +10,5 @@
     bool = int1 == float2
     bool = ptr1 is ptr2
     bool = ptr1 is not ptr2
-    
\ No newline at end of file
+
+foo()
diff -r 57467649c34c tests/compile/ewing1.pyx
--- a/tests/compile/ewing1.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ewing1.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -2,7 +2,9 @@
     pass
 
 cdef void foo():
-    cdef float f
+    cdef float f=0
     cdef int i
     if blarg(<int> f):
         pass
+
+foo()
diff -r 57467649c34c tests/compile/ewing4.pyx
--- a/tests/compile/ewing4.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ewing4.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,2 +1,4 @@
 cdef void f():
     "This is a pseudo doc string."
+
+f()
diff -r 57467649c34c tests/compile/ewing5.pyx
--- a/tests/compile/ewing5.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ewing5.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,2 +1,4 @@
 cdef char *f():
     raise Exception
+
+f()
diff -r 57467649c34c tests/compile/ewing6.pyx
--- a/tests/compile/ewing6.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ewing6.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -19,3 +19,5 @@
 
 cdef void f(D d, E e):
     d.m(e)
+
+f(D(),E())
diff -r 57467649c34c tests/compile/excvalcheck.pyx
--- a/tests/compile/excvalcheck.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/excvalcheck.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -9,3 +9,4 @@
     grail()
     p = tomato()
 
+eggs()
diff -r 57467649c34c tests/compile/excvaldecl.pyx
--- a/tests/compile/excvaldecl.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/excvaldecl.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -15,3 +15,10 @@
 
 cdef int silly() except -1:
     pass
+
+spam()
+eggs()
+grail()
+tomato()
+brian()
+silly()
diff -r 57467649c34c tests/compile/excvalreturn.pyx
--- a/tests/compile/excvalreturn.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/excvalreturn.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,3 +1,4 @@
 cdef int spam() except -1:
     eggs = 42
 
+spam()
diff -r 57467649c34c tests/compile/extcmethcall.pyx
--- a/tests/compile/extcmethcall.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/extcmethcall.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -16,3 +16,5 @@
     spam = superspam
     spam.add_tons(42)
     superspam.add_tons(1764)
+
+tomato()
diff -r 57467649c34c tests/compile/extern.pyx
--- a/tests/compile/extern.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/extern.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -7,3 +7,5 @@
 
 cdef int grail():
     pass
+
+grail()
diff -r 57467649c34c tests/compile/forfromelse.pyx
--- a/tests/compile/forfromelse.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/forfromelse.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,5 +1,5 @@
 cdef void spam():
-    cdef int i, j, k
+    cdef int i, j=0, k=0
     for i from 0 <= i < 10:
         j = k
     else:
@@ -10,3 +10,5 @@
         j = i
     else:
         j = k
+
+spam()
diff -r 57467649c34c tests/compile/gustafsson2.pyx
--- a/tests/compile/gustafsson2.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/gustafsson2.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -6,4 +6,5 @@
     if val == ENUMVALUE_1:
         pass
 
-
+somefunction(ENUMVALUE_1)
+somefunction(ENUMVALUE_2)
diff -r 57467649c34c tests/compile/huss2.pyx
--- a/tests/compile/huss2.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/huss2.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -13,3 +13,5 @@
     e = white
     i = e
     i = e + 1
+
+f()
diff -r 57467649c34c tests/compile/ia_cdefblock.pyx
--- a/tests/compile/ia_cdefblock.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ia_cdefblock.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -31,3 +31,5 @@
 
     void pub_api_f():
         pass
+
+priv_f()
diff -r 57467649c34c tests/compile/index.pyx
--- a/tests/compile/index.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/index.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,7 +1,8 @@
 def f(obj1, obj2, obj3):
-    cdef int int1, int2, int3
-    cdef float flt1, *ptr1
+    cdef int int1, int2=0, int3=0
+    cdef float flt1, *ptr1=NULL
     cdef int array1[42]
+    array1[int2] = 0
     int1 = array1[int2]
     flt1 = ptr1[int2]
     array1[int1] = int2
@@ -13,4 +14,5 @@
     array1[obj2] = int3
     obj1[int2] = obj3
     obj1[obj2] = 42
-    
\ No newline at end of file
+    
+f(None, None, None)
diff -r 57467649c34c tests/compile/ishimoto4.pyx
--- a/tests/compile/ishimoto4.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/ishimoto4.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,2 +1,4 @@
 cdef void __stdcall f():
     pass
+
+f()
diff -r 57467649c34c tests/compile/jiba5.pyx
--- a/tests/compile/jiba5.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/jiba5.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,5 +1,5 @@
 def f():
-    cdef int i
+    cdef int i=0
     global mylist
     del mylist[i]
     return
diff -r 57467649c34c tests/compile/jiba6.pyx
--- a/tests/compile/jiba6.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/jiba6.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -6,3 +6,5 @@
     cdef float* f2
     f2 = f1 + 1
     memcpy(f1, f2, 1)
+
+f()
diff -r 57467649c34c tests/compile/johnson1.pyx
--- a/tests/compile/johnson1.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/johnson1.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -5,3 +5,5 @@
     cdef foo x
     map = [FOO]
     x = map[0]
+
+func()
diff -r 57467649c34c tests/compile/khavkine1.pyx
--- a/tests/compile/khavkine1.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/khavkine1.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -7,3 +7,4 @@
     (<T> obj).a[0] = 1
 
 b = None
+f(NULL)
diff -r 57467649c34c tests/compile/kleckner1.pyx
--- a/tests/compile/kleckner1.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/kleckner1.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -3,3 +3,5 @@
 
 cdef void g(int x,):
     pass
+
+g(0)
diff -r 57467649c34c tests/compile/magcmp.pyx
--- a/tests/compile/magcmp.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/magcmp.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,8 +1,8 @@
 cdef void foo():
-    cdef int bool, int1, int2
+    cdef int bool, int1=0, int2=0
     bool = int1 < int2
     bool = int1 > int2
     bool = int1 <= int2
     bool = int1 >= int2
-    
-    
+
+foo()
diff -r 57467649c34c tests/compile/nogil.pyx
--- a/tests/compile/nogil.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/nogil.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -10,9 +10,12 @@
         y = 42
 
 cdef void h(object x) nogil:
-        cdef void *p
+        cdef void *p=<void*>None
         g2(x)
         g2(<object>p)
         p = <void *>x
         e1()
         e2()
+
+f(0)
+h(None)
diff -r 57467649c34c tests/compile/none.pyx
--- a/tests/compile/none.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/none.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,3 +1,4 @@
 cdef void spam():
     eggs = None
 
+spam()
diff -r 57467649c34c tests/compile/typecast.pyx
--- a/tests/compile/typecast.pyx	Wed Oct 15 12:10:09 2008 -0300
+++ b/tests/compile/typecast.pyx	Wed Oct 15 22:46:14 2008 -0300
@@ -1,7 +1,8 @@
 cdef void f(obj):
-    cdef int i
+    cdef int i=0
     cdef char *p
     p = <char *>i
     obj = <object>p
     p = <char *>obj
-    
\ No newline at end of file
+
+f(None)
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to