fix test suite reducing the signal-to-noise ratio of GCC warnings
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 17 Oct 2008 22:56:14 +0000 (19:56 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 17 Oct 2008 22:56:14 +0000 (19:56 -0300)
46 files changed:
tests/compile/arrayptrcompat.pyx
tests/compile/arraytoptrarg.pyx
tests/compile/ass2longlong.pyx
tests/compile/behnel4.pyx
tests/compile/belchenko1.pyx
tests/compile/builtinfuncs.pyx
tests/compile/cascmp.pyx
tests/compile/cassign.pyx
tests/compile/casttoexttype.pyx
tests/compile/cenum.pyx
tests/compile/cnumop.pyx
tests/compile/coercearraytoptr.pyx
tests/compile/coercetovoidptr.pyx
tests/compile/complexbasetype.pyx
tests/compile/cstructreturn.pyx
tests/compile/cunsignedlong.pyx
tests/compile/declarations.pyx
tests/compile/delslice.pyx
tests/compile/doda1.pyx
tests/compile/emptytry.pyx
tests/compile/enumintcompat.pyx
tests/compile/eqcmp.pyx
tests/compile/ewing1.pyx
tests/compile/ewing4.pyx
tests/compile/ewing5.pyx
tests/compile/ewing6.pyx
tests/compile/excvalcheck.pyx
tests/compile/excvaldecl.pyx
tests/compile/excvalreturn.pyx
tests/compile/extcmethcall.pyx
tests/compile/extern.pyx
tests/compile/forfromelse.pyx
tests/compile/gustafsson2.pyx
tests/compile/huss2.pyx
tests/compile/ia_cdefblock.pyx
tests/compile/index.pyx
tests/compile/ishimoto4.pyx
tests/compile/jiba5.pyx
tests/compile/jiba6.pyx
tests/compile/johnson1.pyx
tests/compile/khavkine1.pyx
tests/compile/kleckner1.pyx
tests/compile/magcmp.pyx
tests/compile/nogil.pyx
tests/compile/none.pyx
tests/compile/typecast.pyx

index 4ba8258bbc3e82c3a0e5ae7eefb51e89b34b0d9a..c38df36a71d2e8a4ea12b6a15feb934445f25754 100644 (file)
@@ -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()
index 243a8d6c30b8cdc3b470d9f489f7bb24b4d2521d..57f9be38dad7f59b6e12f7ed75832df0877bbe6c 100644 (file)
@@ -4,3 +4,4 @@ cdef void f1(char *argv[]):
 cdef void f2(char *argv[]):
     pass
 
+f1(NULL)
index 062853016465514e7483f7686f8fb9adb635ad2f..87457ee145b39d3f1f60a3c5d02b4af2854bd164 100644 (file)
@@ -6,3 +6,5 @@ cdef void spam():
     x = L
     U = x
     x = U
+
+spam()
index 37352e3a73a59bb17532ea7ce57364f96a6bbb74..de064c07188e00256c2ab47b2516ea92704b7f91 100644 (file)
@@ -2,4 +2,6 @@ cdef enum E:
     spam, eggs
 
 cdef E f() except spam:
-    pass
+    return eggs
+
+f()
index d6905f864989548e8ada5c7c24483d198a390c5d..f7437212910ec9d7cef1b180eaafec49420a50da 100644 (file)
@@ -3,3 +3,5 @@ cdef extern from *:
 
 cdef int _is_aligned(void *ptr):
     return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0
+
+_is_aligned(NULL)
index 48a92faa016207426bc518427d0cbc634e00a185..795826c887631a9b2435a2a3a23f40bf080a0fbe 100644 (file)
@@ -21,3 +21,5 @@ cdef int f() except -1:
     #i = typecheck(x, y)
     #i = issubtype(x, y)
     x = abs
+
+f()
index 9fe84ccfa9f2b0d53cf6afcb7a5fac82d5b63833..d2ebddb53ddeb75af1695f731f6c24ffbf1f6a27 100644 (file)
@@ -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()
index 0b35298adf61970072772cdade9cf8e56e1b1997..d51194708ec2a694ce506dd1970f61f20a2e3d83 100644 (file)
@@ -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()    
index caab600289a823ae59838d0659c100e506019aac..518ae0f72c213fff1957a9e376dbd7abfc6e03b8 100644 (file)
@@ -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)
index 00a7e312d690463dabacb881067c3e15631105f8..6ebc0b5cc1fa13b597b7bf075bf3558c8caf8269 100644 (file)
@@ -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()    
index 309e1225c6a7ceea82b3ce0cdbcac9f9ec926e98..d94bd8d19e5ab416096ad651834d1645425943e9 100644 (file)
@@ -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()
index 281de3d9fba924e8c85ce4914e3a9e3b6f27ae8a..5c5ad6521f69fe1989624d5c628ccbb4b66a59f3 100644 (file)
@@ -8,3 +8,5 @@ cdef void eggs():
     cdef Grail grail
     spam(silly)
     spam(grail.silly)
+
+eggs()
index c153316820a781f9b49294ab6705b437b81b5889..38c2705b8d0886b00e805772dc0f78fef8498e42 100644 (file)
@@ -1,5 +1,6 @@
 cdef void f():
     cdef void *p
-    cdef char *q
+    cdef char *q=NULL
     p = q
 
+f()
index 8531b0a2afd88b47bef22d6954895b97d09cc257..2e56dcdce482620b757791914a45c27212aeb28a 100644 (file)
@@ -1,4 +1,6 @@
 cdef extern (int *[42]) spam, grail, swallow
 
 cdef (int (*)()) brian():
-    pass
+    return NULL
+
+brian()
index 6066a7b9ef163a57c3c649331a5948ef442b0df8..9ca00de40632e98ad0427fc85604307607d959c9 100644 (file)
@@ -3,3 +3,5 @@ ctypedef struct Foo:
 
 cdef Foo f():
     blarg = 1 + 2
+
+f()
index 7e7d819c91dbe6ecf5fd9db79b33c69cf6e968f3..fe72850f96d6f4e456aa4c86a48f6631f77c97f1 100644 (file)
@@ -1,5 +1,7 @@
 cdef void f():
     cdef unsigned long x
-    cdef object y
+    cdef object y=0
     x = y
     y = x
+
+f()
index 9f5259d981b2a5cab0e1afaea83457c5eb3cbe6b..2d7efb02c650c62f367ad2c5ceeb00ec7776154e 100644 (file)
@@ -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()
index b1e0d4691e97a84049eb9c2339eb6bec482e4f08..20d192c21ba895c69945839697d6051f7fa3d98b 100644 (file)
@@ -1,3 +1,5 @@
 cdef void spam():
     cdef object x
     del x[17:42]
+
+spam()
index fce43571f0c85e64b7e0204ede6aa1f0f9c736f7..15b089d7f6bb1f9052e25c2aa0f19db8c27a2505 100644 (file)
@@ -9,3 +9,5 @@ cdef Spam foo():
 
 cdef object blarg():
     pass
+
+foo()
index 35e76b823defddddacc47a21f0f881f3da01e512..8cdc71de8e56c43f789abc5c987cd8585d1af109 100644 (file)
@@ -3,3 +3,5 @@ cdef void f():
         pass
     finally:
         pass
+
+f()
index 70c9b40df34ba148013a3820d752cd13679677ec..0a56a6db57e953a2f829434211bc852ed090e2bc 100644 (file)
@@ -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()
index c799c86d391db31ddc81dd3fb9ab06bc722d4e54..ec99f63ba24bc8f5828ec1ef88d24a85d4cee8e5 100644 (file)
@@ -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()
index 1b2e30639211a530e4904e06e2cadcdcd8db281f..689abfc3b8181176f555a1a709657fdc82c6ff61 100644 (file)
@@ -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()
index 266ad47a6b80678ef98f74a8ad15846d836154b3..1d86f3dfcf1b307ef7c03b9330cbede877d07faf 100644 (file)
@@ -1,2 +1,4 @@
 cdef void f():
     "This is a pseudo doc string."
+
+f()
index 33ced96201bdd0633f7cf560e83bca4b9cc2f97b..d55e314e9acd9b0ff508d98ec834273cf14ee436 100644 (file)
@@ -1,2 +1,4 @@
 cdef char *f():
     raise Exception
+
+f()
index 390a6b9011e6a87b8f096e1b5da25f99c544e651..c7c05069648bc09592136316d7198669284d32fc 100644 (file)
@@ -19,3 +19,5 @@ cdef class E:
 
 cdef void f(D d, E e):
     d.m(e)
+
+f(D(),E())
index 3b7f45cde9eb78464170d93a4aa2566790160e9c..4dbce95c90e82070fc9cd27283ace0cf0220dbaf 100644 (file)
@@ -9,3 +9,4 @@ cdef void eggs():
     grail()
     p = tomato()
 
+eggs()
index 6b99e391154178d08509cfcd568d40124e5bb717..fd1a446a315c251cbd1d36b1f7ea6e525e2b8623 100644 (file)
@@ -15,3 +15,10 @@ cdef int brian() except? 0:
 
 cdef int silly() except -1:
     pass
+
+spam()
+eggs()
+grail()
+tomato()
+brian()
+silly()
index 3ed6266ee324f63e70da67d906ac9674978c53fa..ee6a7db896cc309c459c15426b282956317d0bb3 100644 (file)
@@ -1,3 +1,4 @@
 cdef int spam() except -1:
     eggs = 42
 
+spam()
index 2a25845fda7b366872d08e9889fdc4e599b51e41..a6d2cf64311ceec50c51f3f31869d7aef7dabcb0 100644 (file)
@@ -16,3 +16,5 @@ cdef void tomato():
     spam = superspam
     spam.add_tons(42)
     superspam.add_tons(1764)
+
+tomato()
index 8ad35e974548ba3958c5a6712b5db188443b9e99..958e40d6edc72c181bc4f4249f1d5d877f100dd3 100644 (file)
@@ -7,3 +7,5 @@ cdef extern int eggs():
 
 cdef int grail():
     pass
+
+grail()
index 11cad88b3aa46c8adfc8135f400252b46d6970a6..3350320d6d9b2dded9417a8b309ae48e7218c770 100644 (file)
@@ -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()
index de3c99210ff3eba1d6a55447fb41942e84d61444..c4c38f99ea75c00f919e3761515e94a226251571 100644 (file)
@@ -6,4 +6,5 @@ cdef somefunction(someenum_t val):
     if val == ENUMVALUE_1:
         pass
 
-
+somefunction(ENUMVALUE_1)
+somefunction(ENUMVALUE_2)
index c5d1b22c7b9f8070fd409dc9179a5d4549ea1906..061f256676443436c93794646c6f377faacf0755 100644 (file)
@@ -13,3 +13,5 @@ cdef void f():
     e = white
     i = e
     i = e + 1
+
+f()
index 97394c6fa852a8f422ed385dbfc523cf0dab8af8..b542466b65c799d2572e816dfd77db39f8290d58 100644 (file)
@@ -31,3 +31,5 @@ cdef public api:
 
     void pub_api_f():
         pass
+
+priv_f()
index 0dc3bebe493e7e52b6bee6ab56a3b45e87a04525..9c2dd606387ddb8feeb627a99e09829fddc5b637 100644 (file)
@@ -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)
index cace041b9be4bcd466b89d774fa26a65bab443b4..c6bd0df9997023d08e36669bb74a4f9380c164c8 100644 (file)
@@ -1,2 +1,4 @@
 cdef void __stdcall f():
     pass
+
+f()
index 7c6071b9ee1cd241e89cf199fc3127fcc1ef9de6..9a4063f33867aff24b7875f63cdfd8fe287896f9 100644 (file)
@@ -1,5 +1,5 @@
 def f():
-    cdef int i
+    cdef int i=0
     global mylist
     del mylist[i]
     return
index 60bba58a5896952ed9046d1b75e4c0a44c53802c..5470fa074f2e9343b83799e1578337410cfcc63a 100644 (file)
@@ -6,3 +6,5 @@ cdef void f():
     cdef float* f2
     f2 = f1 + 1
     memcpy(f1, f2, 1)
+
+f()
index d6013efed39b220f9b910c11240d296597f87bd5..4b08d22adf20f777a8a13b0b25c602f01d7eb3b7 100644 (file)
@@ -5,3 +5,5 @@ cdef void func():
     cdef foo x
     map = [FOO]
     x = map[0]
+
+func()
index ccafb45c27fbe52c4411b568d75ee3a3aab8c7c6..dce5edbba86860f32ad2419cdd193d4ef327f513 100644 (file)
@@ -7,3 +7,4 @@ cdef void f(void *obj):
     (<T> obj).a[0] = 1
 
 b = None
+f(NULL)
index 57cff9d849bb00fc36d074f0ab978d1ec43381c5..eb8aa28ed0c8e988bc40c4a67d9839bfc9a90204 100644 (file)
@@ -3,3 +3,5 @@ def f(x,):
 
 cdef void g(int x,):
     pass
+
+g(0)
index c2a133bdbd7269d7a89a4120171eea45140a80ef..8f81edc2231e0dfdb024e04127c36a21e227ffdd 100644 (file)
@@ -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()
index ba6f856a6f72fe472543e545d9f478d813cb8a15..213ae60e22138a8c1f8015a7d006a2202d84bbf1 100644 (file)
@@ -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)
index afe11882920a2a90a3fb72658d6a2ca6536347cd..2d51c5caf63ebe6154e05b9e612b6324dd789afb 100644 (file)
@@ -1,3 +1,4 @@
 cdef void spam():
     eggs = None
 
+spam()
index f3945af3dab3a25cb42ab16c1b7373b98ecdefaa..93c1d2c6444af7e754a23673789b311cfb1a36aa 100644 (file)
@@ -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)