Skip to content

Commit 2b68ad3

Browse files
author
Anselm Kruis
committed
Stackless issue python#140: Fix compiler warnings
- fix a warning about an unused expression result in ceval.c - fix a warning about a non literal NULL-pointer initialization in prickelpit.c
1 parent d7a1004 commit 2b68ad3

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3621,7 +3621,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
36213621
#ifdef STACKLESS
36223622
if (STACKLESS_UNWINDING(result)) {
36233623
retval = result;
3624-
POP(); /* compensate for the PUSH(res) after label stackless_call_return: */
3624+
(void) POP(); /* compensate for the PUSH(res) after label stackless_call_return: */
36253625
goto stackless_call;
36263626
}
36273627
#endif

Stackless/pickling/prickelpit.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,16 +1702,20 @@ static int init_methodwrappertype(void)
17021702
static PyTypeObject wrap_PyGen_Type;
17031703
static PyTypeObject wrap_PyCoro_Type;
17041704

1705-
/* Used to initialize a generator created by gen_new.
1706-
Also assert, that the size of generator and coroutines is equal. */
1707-
static PyFrameObject *gen_exhausted_frame = \
1708-
Py_BUILD_ASSERT_EXPR(sizeof(PyGenObject) == sizeof(PyCoroObject)); /* value is 0 */
1705+
/* Used to initialize a generator created by gen_new. */
1706+
static PyFrameObject *gen_exhausted_frame = NULL;
17091707

1708+
/* The usual reduce method.
1709+
* Also assert at compile time, that the size of generator and coroutines is
1710+
* equal.
1711+
*/
17101712
static PyObject *
17111713
_gen_reduce(PyTypeObject *type, PyGenObject *gen)
17121714
{
17131715
PyObject *tup;
17141716
PyObject *frame_reducer = (PyObject *)gen->gi_frame;
1717+
Py_BUILD_ASSERT(sizeof(PyGenObject) == sizeof(PyCoroObject));
1718+
17151719
if (frame_reducer == NULL) {
17161720
/* Pickle NULL as None. See gen_setstate() for the corresponding
17171721
* unpickling code. */

0 commit comments

Comments
 (0)