From d4dd8baa2f023f004582968200060eae987a2d57 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Fri, 17 Oct 2008 19:56:14 -0300 Subject: [PATCH] fix test suite reducing the signal-to-noise ratio of GCC warnings --- tests/compile/arrayptrcompat.pyx | 6 ++++-- tests/compile/arraytoptrarg.pyx | 1 + tests/compile/ass2longlong.pyx | 2 ++ tests/compile/behnel4.pyx | 4 +++- tests/compile/belchenko1.pyx | 2 ++ tests/compile/builtinfuncs.pyx | 2 ++ tests/compile/cascmp.pyx | 4 +++- tests/compile/cassign.pyx | 9 +++++---- tests/compile/casttoexttype.pyx | 2 ++ tests/compile/cenum.pyx | 5 +++-- tests/compile/cnumop.pyx | 10 ++++++---- tests/compile/coercearraytoptr.pyx | 2 ++ tests/compile/coercetovoidptr.pyx | 3 ++- tests/compile/complexbasetype.pyx | 4 +++- tests/compile/cstructreturn.pyx | 2 ++ tests/compile/cunsignedlong.pyx | 4 +++- tests/compile/declarations.pyx | 5 ++++- tests/compile/delslice.pyx | 2 ++ tests/compile/doda1.pyx | 2 ++ tests/compile/emptytry.pyx | 2 ++ tests/compile/enumintcompat.pyx | 10 ++++++---- tests/compile/eqcmp.pyx | 9 +++++---- tests/compile/ewing1.pyx | 4 +++- tests/compile/ewing4.pyx | 2 ++ tests/compile/ewing5.pyx | 2 ++ tests/compile/ewing6.pyx | 2 ++ tests/compile/excvalcheck.pyx | 1 + tests/compile/excvaldecl.pyx | 7 +++++++ tests/compile/excvalreturn.pyx | 1 + tests/compile/extcmethcall.pyx | 2 ++ tests/compile/extern.pyx | 2 ++ tests/compile/forfromelse.pyx | 4 +++- tests/compile/gustafsson2.pyx | 3 ++- tests/compile/huss2.pyx | 2 ++ tests/compile/ia_cdefblock.pyx | 2 ++ tests/compile/index.pyx | 8 +++++--- tests/compile/ishimoto4.pyx | 2 ++ tests/compile/jiba5.pyx | 2 +- tests/compile/jiba6.pyx | 2 ++ tests/compile/johnson1.pyx | 2 ++ tests/compile/khavkine1.pyx | 1 + tests/compile/kleckner1.pyx | 2 ++ tests/compile/magcmp.pyx | 6 +++--- tests/compile/nogil.pyx | 5 ++++- tests/compile/none.pyx | 1 + tests/compile/typecast.pyx | 5 +++-- 46 files changed, 123 insertions(+), 39 deletions(-) diff --git a/tests/compile/arrayptrcompat.pyx b/tests/compile/arrayptrcompat.pyx index 4ba8258b..c38df36a 100644 --- a/tests/compile/arrayptrcompat.pyx +++ b/tests/compile/arrayptrcompat.pyx @@ -5,8 +5,8 @@ cdef void f(): 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 @@ cdef void f(): p = e + a p = a - i p = a - e + +f() diff --git a/tests/compile/arraytoptrarg.pyx b/tests/compile/arraytoptrarg.pyx index 243a8d6c..57f9be38 100644 --- a/tests/compile/arraytoptrarg.pyx +++ b/tests/compile/arraytoptrarg.pyx @@ -4,3 +4,4 @@ cdef void f1(char *argv[]): cdef void f2(char *argv[]): pass +f1(NULL) diff --git a/tests/compile/ass2longlong.pyx b/tests/compile/ass2longlong.pyx index 06285301..87457ee1 100644 --- a/tests/compile/ass2longlong.pyx +++ b/tests/compile/ass2longlong.pyx @@ -6,3 +6,5 @@ cdef void spam(): x = L U = x x = U + +spam() diff --git a/tests/compile/behnel4.pyx b/tests/compile/behnel4.pyx index 37352e3a..de064c07 100644 --- a/tests/compile/behnel4.pyx +++ b/tests/compile/behnel4.pyx @@ -2,4 +2,6 @@ cdef enum E: spam, eggs cdef E f() except spam: - pass + return eggs + +f() diff --git a/tests/compile/belchenko1.pyx b/tests/compile/belchenko1.pyx index d6905f86..f7437212 100644 --- a/tests/compile/belchenko1.pyx +++ b/tests/compile/belchenko1.pyx @@ -3,3 +3,5 @@ cdef extern from *: cdef int _is_aligned(void *ptr): return ((ptr) & ((sizeof(int))-1)) == 0 + +_is_aligned(NULL) diff --git a/tests/compile/builtinfuncs.pyx b/tests/compile/builtinfuncs.pyx index 48a92faa..795826c8 100644 --- a/tests/compile/builtinfuncs.pyx +++ b/tests/compile/builtinfuncs.pyx @@ -21,3 +21,5 @@ cdef int f() except -1: #i = typecheck(x, y) #i = issubtype(x, y) x = abs + +f() diff --git a/tests/compile/cascmp.pyx b/tests/compile/cascmp.pyx index 9fe84ccf..d2ebddb5 100644 --- a/tests/compile/cascmp.pyx +++ b/tests/compile/cascmp.pyx @@ -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 @@ cdef void foo(): bool = obj1 < 2 < 3 bool = obj1 < 2 < 3 < 4 bool = int1 < (int2 == int3) < int4 + +foo() diff --git a/tests/compile/cassign.pyx b/tests/compile/cassign.pyx index 0b35298a..d5119470 100644 --- a/tests/compile/cassign.pyx +++ b/tests/compile/cassign.pyx @@ -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 @@ cdef void foo(): i1 = obj1 p1 = obj1 p1 = "spanish inquisition" - \ No newline at end of file + +foo() diff --git a/tests/compile/casttoexttype.pyx b/tests/compile/casttoexttype.pyx index caab6002..518ae0f7 100644 --- a/tests/compile/casttoexttype.pyx +++ b/tests/compile/casttoexttype.pyx @@ -7,3 +7,5 @@ cdef void foo(object x): cdef void blarg(void *y, object z): foo(y) foo(z) + +blarg(None, None) diff --git a/tests/compile/cenum.pyx b/tests/compile/cenum.pyx index 00a7e312..6ebc0b5c 100644 --- a/tests/compile/cenum.pyx +++ b/tests/compile/cenum.pyx @@ -5,9 +5,10 @@ cdef enum Spam: 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 --git a/tests/compile/cnumop.pyx b/tests/compile/cnumop.pyx index 309e1225..d94bd8d1 100644 --- a/tests/compile/cnumop.pyx +++ b/tests/compile/cnumop.pyx @@ -1,11 +1,13 @@ def f(): - cdef int int1, int2, int3 - cdef char char1 - cdef long long1, long2 - cdef float float1, float2 + cdef int int1, int2=0, int3=1 + cdef char char1=0 + cdef long long1, long2=0 + cdef float float1, float2=0 cdef double double1 int1 = int2 * int3 int1 = int2 / int3 long1 = long2 * char1 float1 = int1 * float2 double1 = float1 * int2 + +f() diff --git a/tests/compile/coercearraytoptr.pyx b/tests/compile/coercearraytoptr.pyx index 281de3d9..5c5ad652 100644 --- a/tests/compile/coercearraytoptr.pyx +++ b/tests/compile/coercearraytoptr.pyx @@ -8,3 +8,5 @@ cdef void eggs(): cdef Grail grail spam(silly) spam(grail.silly) + +eggs() diff --git a/tests/compile/coercetovoidptr.pyx b/tests/compile/coercetovoidptr.pyx index c1533168..38c2705b 100644 --- a/tests/compile/coercetovoidptr.pyx +++ b/tests/compile/coercetovoidptr.pyx @@ -1,5 +1,6 @@ cdef void f(): cdef void *p - cdef char *q + cdef char *q=NULL p = q +f() diff --git a/tests/compile/complexbasetype.pyx b/tests/compile/complexbasetype.pyx index 8531b0a2..2e56dcdc 100644 --- a/tests/compile/complexbasetype.pyx +++ b/tests/compile/complexbasetype.pyx @@ -1,4 +1,6 @@ cdef extern (int *[42]) spam, grail, swallow cdef (int (*)()) brian(): - pass + return NULL + +brian() diff --git a/tests/compile/cstructreturn.pyx b/tests/compile/cstructreturn.pyx index 6066a7b9..9ca00de4 100644 --- a/tests/compile/cstructreturn.pyx +++ b/tests/compile/cstructreturn.pyx @@ -3,3 +3,5 @@ ctypedef struct Foo: cdef Foo f(): blarg = 1 + 2 + +f() diff --git a/tests/compile/cunsignedlong.pyx b/tests/compile/cunsignedlong.pyx index 7e7d819c..fe72850f 100644 --- a/tests/compile/cunsignedlong.pyx +++ b/tests/compile/cunsignedlong.pyx @@ -1,5 +1,7 @@ cdef void f(): cdef unsigned long x - cdef object y + cdef object y=0 x = y y = x + +f() diff --git a/tests/compile/declarations.pyx b/tests/compile/declarations.pyx index 9f5259d9..2d7efb02 100644 --- a/tests/compile/declarations.pyx +++ b/tests/compile/declarations.pyx @@ -12,9 +12,12 @@ cdef extern char *(*cpapfn())[5] cdef extern int fnargfn(int ()) cdef void f(): - cdef void *p + cdef void *p=NULL global ifnp, cpa ifnp = p cdef char *g(): pass + +f() +g() diff --git a/tests/compile/delslice.pyx b/tests/compile/delslice.pyx index b1e0d469..20d192c2 100644 --- a/tests/compile/delslice.pyx +++ b/tests/compile/delslice.pyx @@ -1,3 +1,5 @@ cdef void spam(): cdef object x del x[17:42] + +spam() diff --git a/tests/compile/doda1.pyx b/tests/compile/doda1.pyx index fce43571..15b089d7 100644 --- a/tests/compile/doda1.pyx +++ b/tests/compile/doda1.pyx @@ -9,3 +9,5 @@ cdef Spam foo(): cdef object blarg(): pass + +foo() diff --git a/tests/compile/emptytry.pyx b/tests/compile/emptytry.pyx index 35e76b82..8cdc71de 100644 --- a/tests/compile/emptytry.pyx +++ b/tests/compile/emptytry.pyx @@ -3,3 +3,5 @@ cdef void f(): pass finally: pass + +f() diff --git a/tests/compile/enumintcompat.pyx b/tests/compile/enumintcompat.pyx index 70c9b40d..0a56a6db 100644 --- a/tests/compile/enumintcompat.pyx +++ b/tests/compile/enumintcompat.pyx @@ -5,10 +5,10 @@ cdef enum G: 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 @@ cdef void f(): # f = j ** e # Cython prohibits this i = e + g f = h + +f() diff --git a/tests/compile/eqcmp.pyx b/tests/compile/eqcmp.pyx index c799c86d..ec99f63b 100644 --- a/tests/compile/eqcmp.pyx +++ b/tests/compile/eqcmp.pyx @@ -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 @@ cdef void foo(): bool = int1 == float2 bool = ptr1 is ptr2 bool = ptr1 is not ptr2 - \ No newline at end of file + +foo() diff --git a/tests/compile/ewing1.pyx b/tests/compile/ewing1.pyx index 1b2e3063..689abfc3 100644 --- a/tests/compile/ewing1.pyx +++ b/tests/compile/ewing1.pyx @@ -2,7 +2,9 @@ cdef int blarg(int i): pass cdef void foo(): - cdef float f + cdef float f=0 cdef int i if blarg( f): pass + +foo() diff --git a/tests/compile/ewing4.pyx b/tests/compile/ewing4.pyx index 266ad47a..1d86f3df 100644 --- a/tests/compile/ewing4.pyx +++ b/tests/compile/ewing4.pyx @@ -1,2 +1,4 @@ cdef void f(): "This is a pseudo doc string." + +f() diff --git a/tests/compile/ewing5.pyx b/tests/compile/ewing5.pyx index 33ced962..d55e314e 100644 --- a/tests/compile/ewing5.pyx +++ b/tests/compile/ewing5.pyx @@ -1,2 +1,4 @@ cdef char *f(): raise Exception + +f() diff --git a/tests/compile/ewing6.pyx b/tests/compile/ewing6.pyx index 390a6b90..c7c05069 100644 --- a/tests/compile/ewing6.pyx +++ b/tests/compile/ewing6.pyx @@ -19,3 +19,5 @@ cdef class E: cdef void f(D d, E e): d.m(e) + +f(D(),E()) diff --git a/tests/compile/excvalcheck.pyx b/tests/compile/excvalcheck.pyx index 3b7f45cd..4dbce95c 100644 --- a/tests/compile/excvalcheck.pyx +++ b/tests/compile/excvalcheck.pyx @@ -9,3 +9,4 @@ cdef void eggs(): grail() p = tomato() +eggs() diff --git a/tests/compile/excvaldecl.pyx b/tests/compile/excvaldecl.pyx index 6b99e391..fd1a446a 100644 --- a/tests/compile/excvaldecl.pyx +++ b/tests/compile/excvaldecl.pyx @@ -15,3 +15,10 @@ cdef int brian() except? 0: cdef int silly() except -1: pass + +spam() +eggs() +grail() +tomato() +brian() +silly() diff --git a/tests/compile/excvalreturn.pyx b/tests/compile/excvalreturn.pyx index 3ed6266e..ee6a7db8 100644 --- a/tests/compile/excvalreturn.pyx +++ b/tests/compile/excvalreturn.pyx @@ -1,3 +1,4 @@ cdef int spam() except -1: eggs = 42 +spam() diff --git a/tests/compile/extcmethcall.pyx b/tests/compile/extcmethcall.pyx index 2a25845f..a6d2cf64 100644 --- a/tests/compile/extcmethcall.pyx +++ b/tests/compile/extcmethcall.pyx @@ -16,3 +16,5 @@ cdef void tomato(): spam = superspam spam.add_tons(42) superspam.add_tons(1764) + +tomato() diff --git a/tests/compile/extern.pyx b/tests/compile/extern.pyx index 8ad35e97..958e40d6 100644 --- a/tests/compile/extern.pyx +++ b/tests/compile/extern.pyx @@ -7,3 +7,5 @@ cdef extern int eggs(): cdef int grail(): pass + +grail() diff --git a/tests/compile/forfromelse.pyx b/tests/compile/forfromelse.pyx index 11cad88b..3350320d 100644 --- a/tests/compile/forfromelse.pyx +++ b/tests/compile/forfromelse.pyx @@ -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 @@ cdef void spam(): j = i else: j = k + +spam() diff --git a/tests/compile/gustafsson2.pyx b/tests/compile/gustafsson2.pyx index de3c9921..c4c38f99 100644 --- a/tests/compile/gustafsson2.pyx +++ b/tests/compile/gustafsson2.pyx @@ -6,4 +6,5 @@ cdef somefunction(someenum_t val): if val == ENUMVALUE_1: pass - +somefunction(ENUMVALUE_1) +somefunction(ENUMVALUE_2) diff --git a/tests/compile/huss2.pyx b/tests/compile/huss2.pyx index c5d1b22c..061f2566 100644 --- a/tests/compile/huss2.pyx +++ b/tests/compile/huss2.pyx @@ -13,3 +13,5 @@ cdef void f(): e = white i = e i = e + 1 + +f() diff --git a/tests/compile/ia_cdefblock.pyx b/tests/compile/ia_cdefblock.pyx index 97394c6f..b542466b 100644 --- a/tests/compile/ia_cdefblock.pyx +++ b/tests/compile/ia_cdefblock.pyx @@ -31,3 +31,5 @@ cdef public api: void pub_api_f(): pass + +priv_f() diff --git a/tests/compile/index.pyx b/tests/compile/index.pyx index 0dc3bebe..9c2dd606 100644 --- a/tests/compile/index.pyx +++ b/tests/compile/index.pyx @@ -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 @@ def f(obj1, obj2, obj3): array1[obj2] = int3 obj1[int2] = obj3 obj1[obj2] = 42 - \ No newline at end of file + +f(None, None, None) diff --git a/tests/compile/ishimoto4.pyx b/tests/compile/ishimoto4.pyx index cace041b..c6bd0df9 100644 --- a/tests/compile/ishimoto4.pyx +++ b/tests/compile/ishimoto4.pyx @@ -1,2 +1,4 @@ cdef void __stdcall f(): pass + +f() diff --git a/tests/compile/jiba5.pyx b/tests/compile/jiba5.pyx index 7c6071b9..9a4063f3 100644 --- a/tests/compile/jiba5.pyx +++ b/tests/compile/jiba5.pyx @@ -1,5 +1,5 @@ def f(): - cdef int i + cdef int i=0 global mylist del mylist[i] return diff --git a/tests/compile/jiba6.pyx b/tests/compile/jiba6.pyx index 60bba58a..5470fa07 100644 --- a/tests/compile/jiba6.pyx +++ b/tests/compile/jiba6.pyx @@ -6,3 +6,5 @@ cdef void f(): cdef float* f2 f2 = f1 + 1 memcpy(f1, f2, 1) + +f() diff --git a/tests/compile/johnson1.pyx b/tests/compile/johnson1.pyx index d6013efe..4b08d22a 100644 --- a/tests/compile/johnson1.pyx +++ b/tests/compile/johnson1.pyx @@ -5,3 +5,5 @@ cdef void func(): cdef foo x map = [FOO] x = map[0] + +func() diff --git a/tests/compile/khavkine1.pyx b/tests/compile/khavkine1.pyx index ccafb45c..dce5edbb 100644 --- a/tests/compile/khavkine1.pyx +++ b/tests/compile/khavkine1.pyx @@ -7,3 +7,4 @@ cdef void f(void *obj): ( obj).a[0] = 1 b = None +f(NULL) diff --git a/tests/compile/kleckner1.pyx b/tests/compile/kleckner1.pyx index 57cff9d8..eb8aa28e 100644 --- a/tests/compile/kleckner1.pyx +++ b/tests/compile/kleckner1.pyx @@ -3,3 +3,5 @@ def f(x,): cdef void g(int x,): pass + +g(0) diff --git a/tests/compile/magcmp.pyx b/tests/compile/magcmp.pyx index c2a133bd..8f81edc2 100644 --- a/tests/compile/magcmp.pyx +++ b/tests/compile/magcmp.pyx @@ -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 --git a/tests/compile/nogil.pyx b/tests/compile/nogil.pyx index ba6f856a..213ae60e 100644 --- a/tests/compile/nogil.pyx +++ b/tests/compile/nogil.pyx @@ -10,9 +10,12 @@ cdef void f(int x) nogil: y = 42 cdef void h(object x) nogil: - cdef void *p + cdef void *p=None g2(x) g2(p) p = x e1() e2() + +f(0) +h(None) diff --git a/tests/compile/none.pyx b/tests/compile/none.pyx index afe11882..2d51c5ca 100644 --- a/tests/compile/none.pyx +++ b/tests/compile/none.pyx @@ -1,3 +1,4 @@ cdef void spam(): eggs = None +spam() diff --git a/tests/compile/typecast.pyx b/tests/compile/typecast.pyx index f3945af3..93c1d2c6 100644 --- a/tests/compile/typecast.pyx +++ b/tests/compile/typecast.pyx @@ -1,7 +1,8 @@ cdef void f(obj): - cdef int i + cdef int i=0 cdef char *p p = i obj = p p = obj - \ No newline at end of file + +f(None) -- 2.26.2