]> granicus.if.org Git - python/commitdiff
faulthandler: make quiet a gcc 4.6 warning (z was unused)
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 9 May 2011 12:44:26 +0000 (14:44 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 9 May 2011 12:44:26 +0000 (14:44 +0200)
Modules/faulthandler.c

index 6041485b54ad6aa2777a0f4bcabc150cab4e86f0..6cf06ad2420f3525fd54555dfa8ec6671ab7ea54 100644 (file)
@@ -805,9 +805,12 @@ faulthandler_sigfpe(PyObject *self, PyObject *args)
        PowerPC. Use volatile to disable compile-time optimizations. */
     volatile int x = 1, y = 0, z;
     z = x / y;
-    /* if the division by zero didn't raise a SIGFPE, raise it manually */
+    /* if the division by zero didn't raise a SIGFPE (e.g. on PowerPC),
+       raise it manually */
     raise(SIGFPE);
-    Py_RETURN_NONE;
+    /* use z to make quiet a compiler warning, but this line
+       is never reached */
+    return PyLong_FromLong(z);
 }
 
 static PyObject *