python / cpython

The Python programming language
https://www.python.org
Other
63.36k stars 30.34k forks source link

Compiling 3.13 in MSYS2/UCRT64 causes a type error for _PyTime_AsTime_t #121427

Open Paebbels opened 4 months ago

Paebbels commented 4 months ago

Bug report

Bug description:

Compiling Python 3.13 on MSYS2/UCRT64 causes a type check error for _PyTime_AsTime_t's second parameter.

Python/pytime.c: In function 'pytime_as_timeval_struct':
Python/pytime.c:815:37: error: passing argument 2 of '_PyTime_AsTime_t' from incompatible pointer type [-Wincompatible-pointer-types]
  815 |     res2 = _PyTime_AsTime_t(tv_sec, &tv->tv_sec);
      |                                     ^~~~~~~~~~~
      |                                     |
      |                                     long int *
Python/pytime.c:245:38: note: expected 'time_t *' {aka 'long long int *'} but argument is of type 'long int *'
  245 | _PyTime_AsTime_t(PyTime_t t, time_t *t2)
      |                              ~~~~~~~~^~

How to reproduce:
Environment: MSYS2/UCRT64 Commit: 4aa0c5ec34836a026d06e556784c41e0eeb807b3 (origin/3.13, 3.13)

CXX=g++ ./configure --disable-gil --enable-optimizations --with-lto=full --with-ensurepip=install
make -j16

CPython versions tested on:

Operating systems tested on:

Windows

Linked PRs

serhiy-storchaka commented 3 months ago

cc @vstinner

vstinner commented 3 months ago

Do you want to propose a PR to fix the issue?

MSYS2 is not platform supported by PEP 11, but if you provide a fix, I can review it.

rruuaanng commented 2 days ago

I've raised a PR for this issue, if you don't mind :)