diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-02-09 15:31:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 15:31:26 (GMT) |
commit | bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e (patch) | |
tree | b0bdd00da587355830e8b18fbadc72054ae0ad0c /Modules/timemodule.c | |
parent | 5bb0005f9ff768ac443924b4bb26c3818ce8dc5a (diff) | |
download | cpython-bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e.zip cpython-bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e.tar.gz cpython-bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e.tar.bz2 |
Fix some warnings produced by different compilers. (#5593)
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r-- | Modules/timemodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c index b17ab5a..998216c 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1192,11 +1192,13 @@ _PyTime_GetProcessTimeWithInfo(_PyTime_t *tp, _Py_clock_info_t *info) if (freq != -1) { /* check that _PyTime_MulDiv(t, SEC_TO_NS, ticks_per_second) cannot overflow below */ +#if LONG_MAX > _PyTime_MAX / SEC_TO_NS if ((_PyTime_t)freq > _PyTime_MAX / SEC_TO_NS) { PyErr_SetString(PyExc_OverflowError, "_SC_CLK_TCK is too large"); return -1; } +#endif ticks_per_second = freq; } |