[Python-Dev] RE: [Python-checkins] python/dist/src/Objects listobject.c, 2.218, 2.219

Tim Peters tim.peters at gmail.com
Tue Aug 3 16:53:12 CEST 2004


[Sjoerd Mullender]
> This is indeed perverted.  Another option is to add a statement
>         (void) status;
> somewhere to the function and to remove the status++ from the return.
> This seems to shut up all compilers I've dealt with.

If that's enough to shut compilers up, +1 from me.  MSVC 7.1 doesn't
whine even with no tricks.

I do want to keep the two optimizations in list.pop(), which consist
of not test+branch'ing the return values of two calls that have been
proved safe.  But things change over time, and in a debug build I do
want to assert that they are in fact safe.

I originally did this with a pile of #ifdef Py_DEBUG blocks, but (as
the original checkin comment said) that was even uglier than the
comma-expression hack.


More information about the Python-Dev mailing list