CYGWIN: GCC prints "defined but not used" warnings on mimalloc
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Objects/mimalloc/prim/unix/prim.c and inspect the existing conditional block intended to suppress unused-function warnings on selected platforms. Verify the platform list and check a Cygwin build to confirm the four warnings no longer appear; linked PR gh-146599 indicates work is already underway.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100