Commit d4dd8baa authored by Lisandro Dalcin's avatar Lisandro Dalcin

fix test suite reducing the signal-to-noise ratio of GCC warnings

parent b8fa1e46
...@@ -5,8 +5,8 @@ cdef void f(): ...@@ -5,8 +5,8 @@ cdef void f():
cdef int *p cdef int *p
cdef void *v cdef void *v
cdef int a[5] cdef int a[5]
cdef int i cdef int i=0
cdef E e cdef E e=z
p = a p = a
v = a v = a
p = a + i p = a + i
...@@ -15,3 +15,5 @@ cdef void f(): ...@@ -15,3 +15,5 @@ cdef void f():
p = e + a p = e + a
p = a - i p = a - i
p = a - e p = a - e
f()
...@@ -4,3 +4,4 @@ cdef void f1(char *argv[]): ...@@ -4,3 +4,4 @@ cdef void f1(char *argv[]):
cdef void f2(char *argv[]): cdef void f2(char *argv[]):
pass pass
f1(NULL)
...@@ -6,3 +6,5 @@ cdef void spam(): ...@@ -6,3 +6,5 @@ cdef void spam():
x = L x = L
U = x U = x
x = U x = U
spam()
...@@ -2,4 +2,6 @@ cdef enum E: ...@@ -2,4 +2,6 @@ cdef enum E:
spam, eggs spam, eggs
cdef E f() except spam: cdef E f() except spam:
pass return eggs
f()
...@@ -3,3 +3,5 @@ cdef extern from *: ...@@ -3,3 +3,5 @@ cdef extern from *:
cdef int _is_aligned(void *ptr): cdef int _is_aligned(void *ptr):
return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0 return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0
_is_aligned(NULL)
...@@ -21,3 +21,5 @@ cdef int f() except -1: ...@@ -21,3 +21,5 @@ cdef int f() except -1:
#i = typecheck(x, y) #i = typecheck(x, y)
#i = issubtype(x, y) #i = issubtype(x, y)
x = abs x = abs
f()
cdef void foo(): 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 cdef object obj1, obj2, obj3, obj4
obj1 = 1 obj1 = 1
obj2 = 2 obj2 = 2
...@@ -11,3 +11,5 @@ cdef void foo(): ...@@ -11,3 +11,5 @@ cdef void foo():
bool = obj1 < 2 < 3 bool = obj1 < 2 < 3
bool = obj1 < 2 < 3 < 4 bool = obj1 < 2 < 3 < 4
bool = int1 < (int2 == int3) < int4 bool = int1 < (int2 == int3) < int4
foo()
cdef void foo(): cdef void foo():
cdef int i1, i2 cdef int i1, i2=0
cdef char c1, c2 cdef char c1=0, c2
cdef char *p1, *p2 cdef char *p1, *p2=NULL
i1 = i2 i1 = i2
i1 = c1 i1 = c1
p1 = p2 p1 = p2
...@@ -10,3 +10,4 @@ cdef void foo(): ...@@ -10,3 +10,4 @@ cdef void foo():
p1 = obj1 p1 = obj1
p1 = "spanish inquisition" p1 = "spanish inquisition"
foo()
...@@ -7,3 +7,5 @@ cdef void foo(object x): ...@@ -7,3 +7,5 @@ cdef void foo(object x):
cdef void blarg(void *y, object z): cdef void blarg(void *y, object z):
foo(<Spam>y) foo(<Spam>y)
foo(<Spam>z) foo(<Spam>z)
blarg(<void*>None, None)
...@@ -5,9 +5,10 @@ cdef enum Spam: ...@@ -5,9 +5,10 @@ cdef enum Spam:
g = 42 g = 42
cdef void eggs(): cdef void eggs():
cdef Spam s1, s2 cdef Spam s1, s2=a
cdef int i cdef int i
s1 = s2 s1 = s2
s1 = c s1 = c
i = s1 i = s1
eggs()
def f(): def f():
cdef int int1, int2, int3 cdef int int1, int2=0, int3=1
cdef char char1 cdef char char1=0
cdef long long1, long2 cdef long long1, long2=0
cdef float float1, float2 cdef float float1, float2=0
cdef double double1 cdef double double1
int1 = int2 * int3 int1 = int2 * int3
int1 = int2 / int3 int1 = int2 / int3
long1 = long2 * char1 long1 = long2 * char1
float1 = int1 * float2 float1 = int1 * float2
double1 = float1 * int2 double1 = float1 * int2
f()
...@@ -8,3 +8,5 @@ cdef void eggs(): ...@@ -8,3 +8,5 @@ cdef void eggs():
cdef Grail grail cdef Grail grail
spam(silly) spam(silly)
spam(grail.silly) spam(grail.silly)
eggs()
cdef void f(): cdef void f():
cdef void *p cdef void *p
cdef char *q cdef char *q=NULL
p = q p = q
f()
cdef extern (int *[42]) spam, grail, swallow cdef extern (int *[42]) spam, grail, swallow
cdef (int (*)()) brian(): cdef (int (*)()) brian():
pass return NULL
brian()
...@@ -3,3 +3,5 @@ ctypedef struct Foo: ...@@ -3,3 +3,5 @@ ctypedef struct Foo:
cdef Foo f(): cdef Foo f():
blarg = 1 + 2 blarg = 1 + 2
f()
cdef void f(): cdef void f():
cdef unsigned long x cdef unsigned long x
cdef object y cdef object y=0
x = y x = y
y = x y = x
f()
...@@ -12,9 +12,12 @@ cdef extern char *(*cpapfn())[5] ...@@ -12,9 +12,12 @@ cdef extern char *(*cpapfn())[5]
cdef extern int fnargfn(int ()) cdef extern int fnargfn(int ())
cdef void f(): cdef void f():
cdef void *p cdef void *p=NULL
global ifnp, cpa global ifnp, cpa
ifnp = <int (*)()>p ifnp = <int (*)()>p
cdef char *g(): cdef char *g():
pass pass
f()
g()
cdef void spam(): cdef void spam():
cdef object x cdef object x
del x[17:42] del x[17:42]
spam()
...@@ -9,3 +9,5 @@ cdef Spam foo(): ...@@ -9,3 +9,5 @@ cdef Spam foo():
cdef object blarg(): cdef object blarg():
pass pass
foo()
...@@ -3,3 +3,5 @@ cdef void f(): ...@@ -3,3 +3,5 @@ cdef void f():
pass pass
finally: finally:
pass pass
f()
...@@ -5,10 +5,10 @@ cdef enum G: ...@@ -5,10 +5,10 @@ cdef enum G:
b b
cdef void f(): cdef void f():
cdef E e cdef E e=a
cdef G g cdef G g=b
cdef int i, j cdef int i, j=0
cdef float f, h cdef float f, h=0
i = j | e i = j | e
i = e | j i = e | j
i = j ^ e i = j ^ e
...@@ -23,3 +23,5 @@ cdef void f(): ...@@ -23,3 +23,5 @@ cdef void f():
# f = j ** e # Cython prohibits this # f = j ** e # Cython prohibits this
i = e + g i = e + g
f = h f = h
f()
cdef void foo(): cdef void foo():
cdef int bool, int1, int2 cdef int bool, int1=0, int2=0
cdef float float1, float2 cdef float float1=0, float2=0
cdef char *ptr1, *ptr2 cdef char *ptr1=NULL, *ptr2=NULL
cdef int *ptr3 cdef int *ptr3
bool = int1 == int2 bool = int1 == int2
bool = int1 != int2 bool = int1 != int2
...@@ -11,3 +11,4 @@ cdef void foo(): ...@@ -11,3 +11,4 @@ cdef void foo():
bool = ptr1 is ptr2 bool = ptr1 is ptr2
bool = ptr1 is not ptr2 bool = ptr1 is not ptr2
foo()
...@@ -2,7 +2,9 @@ cdef int blarg(int i): ...@@ -2,7 +2,9 @@ cdef int blarg(int i):
pass pass
cdef void foo(): cdef void foo():
cdef float f cdef float f=0
cdef int i cdef int i
if blarg(<int> f): if blarg(<int> f):
pass pass
foo()
cdef void f(): cdef void f():
"This is a pseudo doc string." "This is a pseudo doc string."
f()
cdef char *f(): cdef char *f():
raise Exception raise Exception
f()
...@@ -19,3 +19,5 @@ cdef class E: ...@@ -19,3 +19,5 @@ cdef class E:
cdef void f(D d, E e): cdef void f(D d, E e):
d.m(e) d.m(e)
f(D(),E())
...@@ -9,3 +9,4 @@ cdef void eggs(): ...@@ -9,3 +9,4 @@ cdef void eggs():
grail() grail()
p = tomato() p = tomato()
eggs()
...@@ -15,3 +15,10 @@ cdef int brian() except? 0: ...@@ -15,3 +15,10 @@ cdef int brian() except? 0:
cdef int silly() except -1: cdef int silly() except -1:
pass pass
spam()
eggs()
grail()
tomato()
brian()
silly()
cdef int spam() except -1: cdef int spam() except -1:
eggs = 42 eggs = 42
spam()
...@@ -16,3 +16,5 @@ cdef void tomato(): ...@@ -16,3 +16,5 @@ cdef void tomato():
spam = superspam spam = superspam
spam.add_tons(42) spam.add_tons(42)
superspam.add_tons(1764) superspam.add_tons(1764)
tomato()
...@@ -7,3 +7,5 @@ cdef extern int eggs(): ...@@ -7,3 +7,5 @@ cdef extern int eggs():
cdef int grail(): cdef int grail():
pass pass
grail()
cdef void spam(): cdef void spam():
cdef int i, j, k cdef int i, j=0, k=0
for i from 0 <= i < 10: for i from 0 <= i < 10:
j = k j = k
else: else:
...@@ -10,3 +10,5 @@ cdef void spam(): ...@@ -10,3 +10,5 @@ cdef void spam():
j = i j = i
else: else:
j = k j = k
spam()
...@@ -6,4 +6,5 @@ cdef somefunction(someenum_t val): ...@@ -6,4 +6,5 @@ cdef somefunction(someenum_t val):
if val == ENUMVALUE_1: if val == ENUMVALUE_1:
pass pass
somefunction(ENUMVALUE_1)
somefunction(ENUMVALUE_2)
...@@ -13,3 +13,5 @@ cdef void f(): ...@@ -13,3 +13,5 @@ cdef void f():
e = white e = white
i = e i = e
i = e + 1 i = e + 1
f()
...@@ -31,3 +31,5 @@ cdef public api: ...@@ -31,3 +31,5 @@ cdef public api:
void pub_api_f(): void pub_api_f():
pass pass
priv_f()
def f(obj1, obj2, obj3): def f(obj1, obj2, obj3):
cdef int int1, int2, int3 cdef int int1, int2=0, int3=0
cdef float flt1, *ptr1 cdef float flt1, *ptr1=NULL
cdef int array1[42] cdef int array1[42]
array1[int2] = 0
int1 = array1[int2] int1 = array1[int2]
flt1 = ptr1[int2] flt1 = ptr1[int2]
array1[int1] = int2 array1[int1] = int2
...@@ -14,3 +15,4 @@ def f(obj1, obj2, obj3): ...@@ -14,3 +15,4 @@ def f(obj1, obj2, obj3):
obj1[int2] = obj3 obj1[int2] = obj3
obj1[obj2] = 42 obj1[obj2] = 42
f(None, None, None)
cdef void __stdcall f(): cdef void __stdcall f():
pass pass
f()
def f(): def f():
cdef int i cdef int i=0
global mylist global mylist
del mylist[i] del mylist[i]
return return
...@@ -6,3 +6,5 @@ cdef void f(): ...@@ -6,3 +6,5 @@ cdef void f():
cdef float* f2 cdef float* f2
f2 = f1 + 1 f2 = f1 + 1
memcpy(f1, f2, 1) memcpy(f1, f2, 1)
f()
...@@ -5,3 +5,5 @@ cdef void func(): ...@@ -5,3 +5,5 @@ cdef void func():
cdef foo x cdef foo x
map = [FOO] map = [FOO]
x = map[0] x = map[0]
func()
...@@ -7,3 +7,4 @@ cdef void f(void *obj): ...@@ -7,3 +7,4 @@ cdef void f(void *obj):
(<T> obj).a[0] = 1 (<T> obj).a[0] = 1
b = None b = None
f(NULL)
...@@ -3,3 +3,5 @@ def f(x,): ...@@ -3,3 +3,5 @@ def f(x,):
cdef void g(int x,): cdef void g(int x,):
pass pass
g(0)
cdef void foo(): 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
bool = int1 <= int2 bool = int1 <= int2
bool = int1 >= int2 bool = int1 >= int2
foo()
...@@ -10,9 +10,12 @@ cdef void f(int x) nogil: ...@@ -10,9 +10,12 @@ cdef void f(int x) nogil:
y = 42 y = 42
cdef void h(object x) nogil: cdef void h(object x) nogil:
cdef void *p cdef void *p=<void*>None
g2(x) g2(x)
g2(<object>p) g2(<object>p)
p = <void *>x p = <void *>x
e1() e1()
e2() e2()
f(0)
h(None)
cdef void spam(): cdef void spam():
eggs = None eggs = None
spam()
cdef void f(obj): cdef void f(obj):
cdef int i cdef int i=0
cdef char *p cdef char *p
p = <char *>i p = <char *>i
obj = <object>p obj = <object>p
p = <char *>obj p = <char *>obj
f(None)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment