Skip to content

Commit aebaa1d

Browse files
CYGWIN: fix "defined but not used" warnings on mimalloc
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.
1 parent 578d726 commit aebaa1d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • Objects/mimalloc/prim/unix

Objects/mimalloc/prim/unix/prim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static int mi_prim_access(const char *fpath, int mode) {
7777
return syscall(SYS_access,fpath,mode);
7878
}
7979

80-
#elif !defined(__APPLE__) && !defined(_AIX) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(__NetBSD__) // avoid unused warnings
80+
#elif !defined(__APPLE__) && !defined(_AIX) && !defined(__CYGWIN__) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__sun) && !defined(__NetBSD__) // avoid unused warnings
8181

8282
static int mi_prim_open(const char* fpath, int open_flags) {
8383
return open(fpath,open_flags);

0 commit comments

Comments
 (0)