[pypy-issue] [issue1640] Posix 2001 ftime() is deprecated

Tobias Oberstein tracker at bugs.pypy.org
Sun Nov 17 21:40:16 CET 2013

Tobias Oberstein <tobias.oberstein at gmail.com> added the comment:

CPython 2.7.6 tests for ftime() availability


and then only includes if HAVE_FTIME


On above build log, ftime() is undetected - I'm not sure how that works, since
ftime() is still there on FreeBSD (as is the header sys/timeb.h), but it's
deprecated .. and Clang will produce a warning.

As far as I can see from the source here


CPy will prefer gettimeofday to ftime, even if both are available. I find that C
style .. strange. They have 2 blocks of C, where the first returns, so the
second is unreachable code if both HAVE_GETTIMEOFDAY and HAVE_FTIME are defined.

In no case does CPy 2 use clock_gettime() - which is a pity.

It seems, this is only available in CPy 3 via

So if PyPy is to model CPy 2, we might use gettimeofday() when avail, otherwise
fallback to ftime().

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list