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
派生
35.9k
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 摘要。