GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CYGWIN: fix "defined but not used" warnings on mimalloc by carlo-bramini · Pull Request #146572 · python/cpython

Conversation

@carlo-bramini

@carlo-bramini carlo-bramini commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

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.
Unfortunately, CYGWIN is missing in this list.
However, adding it is very easy and the change is self-explanatory, as you can see.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@carlo-bramini
CYGWIN: fix "defined but not used" warnings on mimalloc
aebaa1d
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.
Unfortunately, CYGWIN is missing in this list.
However, adding it is very easy and the change is self-explanatory, as you can see.
@bedevere-app

bedevere-app Bot commented Mar 28, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@python-cla-bot

python-cla-bot Bot commented Mar 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Mar 28, 2026
@picnixz

picnixz commented Mar 28, 2026

Copy link
Copy Markdown
Member

Please report those issues upstream. mimalloc is a vendored copy which we do not modify.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz picnixz closed this Mar 28, 2026
@carlo-bramini

carlo-bramini commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

Please report those issues upstream. mimalloc is a vendored copy which we do not modify.

Excuse me, probably I'm doing a mistake but this doesn't appear to be true.
By looking the history of the file, it looks like that this file has been already fixed locally.
The same identical fix has been already done for other platforms, for example:

0ff6368
ae968d1
4a6b1f1

and those fixes are not available into the upstream of mimalloc, by reading the code at https://github.com/microsoft/mimalloc.
Thank you very much for your time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Mar 28, 2026

Copy link
Copy Markdown
Member

Oh, my bad. I thought we legally needed to do this actually, my bad. Please open a new PR (the branch/repo seems to be deleted so I can't reopen the PR)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Mar 28, 2026

Copy link
Copy Markdown
Member

Hum. I am not sure actually. Because ae968d1 has an upstream patch. Let me check.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz

picnixz commented Mar 28, 2026

Copy link
Copy Markdown
Member

See #113141 as well. Now, I'd suggest that you first open an issue so that we can properly track this change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@carlo-bramini carlo-bramini mentioned this pull request Mar 29, 2026
CYGWIN: GCC prints "defined but not used" warnings on mimalloc #146594
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@carlo-bramini @picnixz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.