python / python/cpython

CYGWIN: GCC prints "defined but not used" warnings on mimalloc

未關閉
#146,594 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

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

描述

Bug report

Bug description:

Compiling under CYGWIN prints these warning messages:

In file included from ../cpython/Objects/mimalloc/prim/prim.c:22,
                 from ../cpython/Objects/mimalloc/static.c:37,
                 from ../cpython/Objects/obmalloc.c:23:
../cpython/Objects/mimalloc/prim/unix/prim.c:91:12: warning: ‘mi_prim_access’ defined but not used [-Wunused-function]
   91 | static int mi_prim_access(const char *fpath, int mode) {
      |            ^~~~~~~~~~~~~~
../cpython/Objects/mimalloc/prim/unix/prim.c:88:12: warning: ‘mi_prim_close’ defined but not used [-Wunused-function]
   88 | static int mi_prim_close(int fd) {
      |            ^~~~~~~~~~~~~
../cpython/Objects/mimalloc/prim/unix/prim.c:85:16: warning: ‘mi_prim_read’ defined but not used [-Wunused-function]
   85 | static ssize_t mi_prim_read(int fd, void* buf, size_t bufsize) {
      |                ^~~~~~~~~~~~
../cpython/Objects/mimalloc/prim/unix/prim.c:82:12: warning: ‘mi_prim_open’ defined but not used [-Wunused-function]
   82 | static int mi_prim_open(const char* fpath, int open_flags) {
      |            ^~~~~~~~~~~~

Looking into the code of Objects/mimalloc/prim/unix/prim.c, there is already a conditional block to avoid the generation of such warnings.
The solution for this issue is to simply add CYGWIN to that list of platforms.
So, I'm posting this issue according to the suggestion received into #146572 for tracking this change.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs
  • gh-146599

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從 Objects/mimalloc/prim/unix/prim.c 開始,檢查現有的條件程式區塊,該區塊用於抑制所選平台上未使用函式的警告。驗證平台清單,並執行一次 Cygwin 建置,以確認這四個警告不再出現;關聯的 PR gh-146599 表示相關工作已在進行中。

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

評估

技術堆疊
c
領域
operating-systems
Issue 類型
缺陷
難度
1/5
預估耗時
1 小時以內
活躍度
停滯
描述清晰度
描述清楚
新手友好度
25/100

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

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