python / python/cpython

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

未關閉
#121,427 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

build OS-windows type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

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:
  • 3.12
  • 3.13
Operating systems tested on:

Windows

Linked PRs
  • gh-126355

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Python/pytime.c 中的 pytime_as_timeval_struct 和 _PyTime_AsTime_t 開始,然後使用 MSYS2/UCRT64 的 configure 和 make 命令重現回報的建置。Python 3.13 建置在沒有 incompatible-pointer-type 錯誤的情況下完成即表示完成;應先審查相關的 PR gh-126355。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
c, python
領域
build-system, operating-systems
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。