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():
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()
......@@ -4,3 +4,4 @@ cdef void f1(char *argv[]):
cdef void f2(char *argv[]):
pass
f1(NULL)
......@@ -6,3 +6,5 @@ cdef void spam():
x = L
U = x
x = U
spam()
......@@ -2,4 +2,6 @@ cdef enum E:
spam, eggs
cdef E f() except spam:
pass
return eggs
f()
......@@ -3,3 +3,5 @@ cdef extern from *:
cdef int _is_aligned(void *ptr):
return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0
_is_aligned(NULL)
......@@ -21,3 +21,5 @@ cdef int f() except -1:
#i = typecheck(x, y)
#i = issubtype(x, y)
x = abs
f()
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()
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()
......@@ -7,3 +7,5 @@ cdef void foo(object x):
cdef void blarg(void *y, object z):
foo(<Spam>y)
foo(<Spam>z)
blarg(<void*>None, None)
......@@ -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()
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()
......@@ -8,3 +8,5 @@ cdef void eggs():
cdef Grail grail
spam(silly)
spam(grail.silly)
eggs()
cdef void f():
cdef void *p
cdef char *q
cdef char *q=NULL
p = q
f()
cdef extern (int *[42]) spam, grail, swallow
cdef (int (*)()) brian():
pass
return NULL
brian()
......@@ -3,3 +3,5 @@ ctypedef struct Foo:
cdef Foo f():
blarg = 1 + 2
f()
cdef void f():
cdef unsigned long x
cdef object y
cdef object y=0
x = y
y = x
f()
......@@ -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 = <int (*)()>p
cdef char *g():
pass
f()
g()
cdef void spam():
cdef object x
del x[17:42]
spam()
......@@ -9,3 +9,5 @@ cdef Spam foo():
cdef object blarg():
pass
foo()
......@@ -3,3 +3,5 @@ cdef void f():
pass
finally:
pass
f()
......@@ -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()
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()
......@@ -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(<int> f):
pass
foo()
cdef void f():
"This is a pseudo doc string."
f()
cdef char *f():
raise Exception
f()
......@@ -19,3 +19,5 @@ cdef class E:
cdef void f(D d, E e):
d.m(e)
f(D(),E())
......@@ -9,3 +9,4 @@ cdef void eggs():
grail()
p = tomato()
eggs()
......@@ -15,3 +15,10 @@ cdef int brian() except? 0:
cdef int silly() except -1:
pass
spam()
eggs()
grail()
tomato()
brian()
silly()
cdef int spam() except -1:
eggs = 42
spam()
......@@ -16,3 +16,5 @@ cdef void tomato():
spam = superspam
spam.add_tons(42)
superspam.add_tons(1764)
tomato()
......@@ -7,3 +7,5 @@ cdef extern int eggs():
cdef int grail():
pass
grail()
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()
......@@ -6,4 +6,5 @@ cdef somefunction(someenum_t val):
if val == ENUMVALUE_1:
pass
somefunction(ENUMVALUE_1)
somefunction(ENUMVALUE_2)
......@@ -13,3 +13,5 @@ cdef void f():
e = white
i = e
i = e + 1
f()
......@@ -31,3 +31,5 @@ cdef public api:
void pub_api_f():
pass
priv_f()
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)
cdef void __stdcall f():
pass
f()
def f():
cdef int i
cdef int i=0
global mylist
del mylist[i]
return
......@@ -6,3 +6,5 @@ cdef void f():
cdef float* f2
f2 = f1 + 1
memcpy(f1, f2, 1)
f()
......@@ -5,3 +5,5 @@ cdef void func():
cdef foo x
map = [FOO]
x = map[0]
func()
......@@ -7,3 +7,4 @@ cdef void f(void *obj):
(<T> obj).a[0] = 1
b = None
f(NULL)
......@@ -3,3 +3,5 @@ def f(x,):
cdef void g(int x,):
pass
g(0)
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()
......@@ -10,9 +10,12 @@ cdef void f(int x) nogil:
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)
cdef void spam():
eggs = None
spam()
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)
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