mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #22117: Try to fix rounding in conversion from Python double to _PyTime_t
using the C volatile keyword.
This commit is contained in:
parent
e134a7fe36
commit
45cff0c0e6
1 changed files with 2 additions and 1 deletions
|
@ -207,7 +207,8 @@ int
|
|||
_PyTime_FromSecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round)
|
||||
{
|
||||
if (PyFloat_Check(obj)) {
|
||||
double d, err;
|
||||
/* volatile avoids unsafe optimization on float enabled by gcc -O3 */
|
||||
volatile double d, err;
|
||||
|
||||
/* convert to a number of nanoseconds */
|
||||
d = PyFloat_AsDouble(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue