Comments (15)
For the first one you can just include <errno.h>
, it should fix this.
from mimalloc.
@superriva No, the non-capitalisation of <windows.h> in MinGW is the error. The windows SDK has since eternity ;-)) used the capitalised version <Windows.h>.
from mimalloc.
Some information about the problem:
https://stackoverflow.com/questions/15466613/lowercase-windows-h-and-uppercase-windows-h-difference
from mimalloc.
@superriva I know what the problem is, but until changed, the 'real deal' of this header is with a capital W, MinGW has f'ed it up.
from mimalloc.
I think I fixed the issues by using windows.h
and including errno.h
(commit f073186). Let me know if it works now :-)
from mimalloc.
@daanx , yes it's compiled now (with patch #22). Thx.
from mimalloc.
@daanx There's a few another warnings with MinGW-W64 GCC-8.1.0 x86_64-posix-seh on Windows:
Just an unused parameter:
E:\C\Mimalloc\src\init.c: In function 'DllMain':
E:\C\Mimalloc\src\init.c:390:55: warning: unused parameter 'inst' [-Wunused-parameter]
__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
~~~~~~~~~~^~~~
E:\C\Mimalloc\src\init.c:390:82: warning: unused parameter 'reserved' [-Wunused-parameter]
__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
<fibersapi.h>
is not included:
E:\C\Mimalloc\src\init.c: In function 'mi_process_setup_auto_thread_done':
E:\C\Mimalloc\src\init.c:290:18: warning: implicit declaration of function 'FlsAlloc'; did you mean 'TlsAlloc'? [-Wimplicit-function-declaration]
mi_fls_key = FlsAlloc(&mi_fls_done);
^~~~~~~~
TlsAlloc
E:\C\Mimalloc\src\init.c: In function 'mi_thread_init':
E:\C\Mimalloc\src\init.c:319:5: warning: implicit declaration of function 'FlsSetValue'; did you mean 'TlsSetValue'? [-Wimplicit-function-declaration]
FlsSetValue(mi_fls_key, (void*)(_mi_thread_id()|1)); // set to a dummy value so that `mi_fls_done` is called
^~~~~~~~~~~
TlsSetValue
from mimalloc.
May be interesting warnings on Linux with MinGW:
[mimalloc-sys 0.1.1] -- The C compiler identification is GNU 7.3.0
[mimalloc-sys 0.1.1] -- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc
[mimalloc-sys 0.1.1] -- Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc -- works
[mimalloc-sys 0.1.1] -- Detecting C compiler ABI info
[mimalloc-sys 0.1.1] -- Detecting C compiler ABI info - done
[mimalloc-sys 0.1.1] -- Detecting C compile features
[mimalloc-sys 0.1.1] -- Detecting C compile features - done
[mimalloc-sys 0.1.1] -- Build type specified as *** Debug ***
[mimalloc-sys 0.1.1] -- Output library name : mimalloc-debug
[mimalloc-sys 0.1.1] -- Installation directory: lib/mimalloc-1.0
[mimalloc-sys 0.1.1] -- Configuring done
[mimalloc-sys 0.1.1] -- Generating done
[mimalloc-sys 0.1.1] CMake Warning:
[mimalloc-sys 0.1.1] Manually-specified variables were not used by the project:
[mimalloc-sys 0.1.1]
[mimalloc-sys 0.1.1] CMAKE_CXX_COMPILER
[mimalloc-sys 0.1.1] CMAKE_CXX_FLAGS
[mimalloc-sys 0.1.1]
[mimalloc-sys 0.1.1]
[mimalloc-sys 0.1.1] -- Build files have been written to: /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build
[mimalloc-sys 0.1.1] running: "cmake" "--build" "." "--target" "install" "--config" "Debug" "--"
[mimalloc-sys 0.1.1] Scanning dependencies of target mimalloc-obj
[mimalloc-sys 0.1.1] Scanning dependencies of target mimalloc-static
[mimalloc-sys 0.1.1] Scanning dependencies of target mimalloc
[mimalloc-sys 0.1.1] [ 14%] Building C object CMakeFiles/mimalloc-obj.dir/src/static.c.obj
[mimalloc-sys 0.1.1] [ 14%] Building C object CMakeFiles/mimalloc-static.dir/src/os.c.obj
[mimalloc-sys 0.1.1] [ 14%] Building C object CMakeFiles/mimalloc-static.dir/src/stats.c.obj
[mimalloc-sys 0.1.1] [ 19%] Building C object CMakeFiles/mimalloc.dir/src/stats.c.obj
[mimalloc-sys 0.1.1] [ 23%] Building C object CMakeFiles/mimalloc-static.dir/src/segment.c.obj
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c: In function ‘mi_stats_print_bins’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c:191:31: warning: unknown conversion type character ‘z’ in format [-Wformat=]
[mimalloc-sys 0.1.1] snprintf(buf, 64, "%s %3zd", fmt, i);
[mimalloc-sys 0.1.1] ^
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c:191:25: warning: too many arguments for format [-Wformat-extra-args]
[mimalloc-sys 0.1.1] snprintf(buf, 64, "%s %3zd", fmt, i);
[mimalloc-sys 0.1.1] ^~~~~~~~~
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c: In function ‘mi_stats_print_bins’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c:191:31: warning: unknown conversion type character ‘z’ in format [-Wformat=]
[mimalloc-sys 0.1.1] snprintf(buf, 64, "%s %3zd", fmt, i);
[mimalloc-sys 0.1.1] ^
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c:191:25: warning: too many arguments for format [-Wformat-extra-args]
[mimalloc-sys 0.1.1] snprintf(buf, 64, "%s %3zd", fmt, i);
[mimalloc-sys 0.1.1] ^~~~~~~~~
[mimalloc-sys 0.1.1] In file included from /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/static.c:16:0:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c: In function ‘mi_stats_print_bins’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c:191:31: warning: unknown conversion type character ‘z’ in format [-Wformat=]
[mimalloc-sys 0.1.1] snprintf(buf, 64, "%s %3zd", fmt, i);
[mimalloc-sys 0.1.1] ^
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/stats.c:191:25: warning: too many arguments for format [-Wformat-extra-args]
[mimalloc-sys 0.1.1] snprintf(buf, 64, "%s %3zd", fmt, i);
[mimalloc-sys 0.1.1] ^~~~~~~~~
[mimalloc-sys 0.1.1] [ 28%] Building C object CMakeFiles/mimalloc.dir/src/os.c.obj
[mimalloc-sys 0.1.1] In file included from /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/static.c:23:0:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c: In function ‘mi_process_setup_auto_thread_done’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c:290:18: warning: implicit declaration of function ‘FlsAlloc’; did you mean ‘TlsAlloc’? [-Wimplicit-function-declaration]
[mimalloc-sys 0.1.1] mi_fls_key = FlsAlloc(&mi_fls_done);
[mimalloc-sys 0.1.1] ^~~~~~~~
[mimalloc-sys 0.1.1] TlsAlloc
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c: In function ‘mi_thread_init’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c:319:5: warning: implicit declaration of function ‘FlsSetValue’; did you mean ‘TlsSetValue’? [-Wimplicit-function-declaration]
[mimalloc-sys 0.1.1] FlsSetValue(mi_fls_key, (void*)(_mi_thread_id()|1)); // set to a dummy value so that `mi_fls_done` is called
[mimalloc-sys 0.1.1] ^~~~~~~~~~~
[mimalloc-sys 0.1.1] TlsSetValue
[mimalloc-sys 0.1.1] [ 33%] Building C object CMakeFiles/mimalloc-static.dir/src/page.c.obj
[mimalloc-sys 0.1.1] [ 38%] Building C object CMakeFiles/mimalloc-static.dir/src/alloc.c.obj
[mimalloc-sys 0.1.1] [ 42%] Building C object CMakeFiles/mimalloc-static.dir/src/alloc-aligned.c.obj
[mimalloc-sys 0.1.1] [ 47%] Building C object CMakeFiles/mimalloc.dir/src/segment.c.obj
[mimalloc-sys 0.1.1] [ 52%] Building C object CMakeFiles/mimalloc-static.dir/src/heap.c.obj
[mimalloc-sys 0.1.1] [ 57%] Building C object CMakeFiles/mimalloc-static.dir/src/options.c.obj
[mimalloc-sys 0.1.1] [ 57%] Built target mimalloc-obj
[mimalloc-sys 0.1.1] [ 61%] Building C object CMakeFiles/mimalloc-static.dir/src/init.c.obj
[mimalloc-sys 0.1.1] [ 66%] Building C object CMakeFiles/mimalloc.dir/src/page.c.obj
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c: In function ‘mi_process_setup_auto_thread_done’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c:290:18: warning: implicit declaration of function ‘FlsAlloc’; did you mean ‘TlsAlloc’? [-Wimplicit-function-declaration]
[mimalloc-sys 0.1.1] mi_fls_key = FlsAlloc(&mi_fls_done);
[mimalloc-sys 0.1.1] ^~~~~~~~
[mimalloc-sys 0.1.1] TlsAlloc
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c: In function ‘mi_thread_init’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c:319:5: warning: implicit declaration of function ‘FlsSetValue’; did you mean ‘TlsSetValue’? [-Wimplicit-function-declaration]
[mimalloc-sys 0.1.1] FlsSetValue(mi_fls_key, (void*)(_mi_thread_id()|1)); // set to a dummy value so that `mi_fls_done` is called
[mimalloc-sys 0.1.1] ^~~~~~~~~~~
[mimalloc-sys 0.1.1] TlsSetValue
[mimalloc-sys 0.1.1] [ 71%] Building C object CMakeFiles/mimalloc.dir/src/alloc.c.obj
[mimalloc-sys 0.1.1] [ 76%] Building C object CMakeFiles/mimalloc.dir/src/alloc-aligned.c.obj
[mimalloc-sys 0.1.1] [ 80%] Linking C static library libmimalloc-static-debug.a
[mimalloc-sys 0.1.1] [ 85%] Building C object CMakeFiles/mimalloc.dir/src/heap.c.obj
[mimalloc-sys 0.1.1] [ 85%] Built target mimalloc-static
[mimalloc-sys 0.1.1] [ 90%] Building C object CMakeFiles/mimalloc.dir/src/options.c.obj
[mimalloc-sys 0.1.1] [ 95%] Building C object CMakeFiles/mimalloc.dir/src/init.c.obj
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c: In function ‘DllMain’:
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c:390:55: warning: unused parameter ‘inst’ [-Wunused-parameter]
[mimalloc-sys 0.1.1] __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
[mimalloc-sys 0.1.1] ^~~~
[mimalloc-sys 0.1.1] /at/rust/projects/mim/mimallocator/mimalloc-sys/target/x86_64-pc-windows-gnu/debug/build/mimalloc-sys-72e0bee9822e0195/out/build/mimalloc/src/init.c:390:82: warning: unused parameter ‘reserved’ [-Wunused-parameter]
[mimalloc-sys 0.1.1] __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) {
[mimalloc-sys 0.1.1] ^~~~~~~~
[mimalloc-sys 0.1.1] [100%] Linking C shared library libmimalloc-debug.dll
[mimalloc-sys 0.1.1] [100%] Built target mimalloc
from mimalloc.
@nxrighthere : I think I fixed the warnings in latest master
@superriva : interesting that there are warnings about %zd
-- I thought this was standard for size_t
types now?
from mimalloc.
@daanx Strange, FlsAlloc
/FlsSetValue
implicit declaration warnings are still there while the appropriate header is included now. 🤔
from mimalloc.
And fibersapi.h
is actually a part of winbase.h
which is a part of windows.h
, say whaaat? Why these warnings are still a thing?
from mimalloc.
interesting that there are warnings about %zd -- I thought this was standard for size_t types now?
@daanx Use %zu
. %zd
is for "signed size_t"
from mimalloc.
Fixed the format specifiers in commit f36149a. Thanks everyone.
from mimalloc.
Can we close this issue?
from mimalloc.
The problem with Fibers API is still unresolved on Windows nor on Linux:
E:\C\Mimalloc\src\init.c: In function 'mi_process_setup_auto_thread_done':
E:\C\Mimalloc\src\init.c:295:18: warning: implicit declaration of function 'FlsAlloc'; did you mean 'TlsAlloc'? [-Wimplicit-function-declaration]
mi_fls_key = FlsAlloc(&mi_fls_done);
^~~~~~~~
TlsAlloc
E:\C\Mimalloc\src\init.c: In function 'mi_thread_init':
E:\C\Mimalloc\src\init.c:324:5: warning: implicit declaration of function 'FlsSetValue'; did you mean 'TlsSetValue'? [-Wimplicit-function-declaration]
FlsSetValue(mi_fls_key, (void*)(_mi_thread_id()|1)); // set to a dummy value so that `mi_fls_done` is called
^~~~~~~~~~~
TlsSetValue
from mimalloc.
Related Issues (20)
- [suggestion] add a comment at the declaration of `mi_arena_t` for easier custom modify HOT 1
- Can't compile v2.1.6 tag on Ubuntu 22.04.LTS HOT 3
- malloc_good_size in overrides HOT 13
- Is it ok that `ld-linux-x86-64.so.2` `Scrt1.o` `crti.o` and `crtbeginS.o` is located before `mimalloc.o` in the linker commandline when static override malloc? HOT 1
- Inconsistent output naming of `mimalloc.dll` HOT 4
- 2.1.4: crash in mi_segment_try_purge during mi_process_done HOT 2
- Misplaced count size HOT 1
- mimalloc.o not available in vcpkg
- mimalloc-redirect for aarch64? HOT 1
- Cannot build mimalloc-2.1.7 with mingw32-8.5.0 HOT 1
- why mi_bin() return MI_BIN_HUGE if wsize > MI_MEDIUM_OBJ_WSIZE_MAX
- Is this a bug? segment-map.c uses an undefined constant MAX_UINT32 HOT 1
- memory decommit does not work with large pages HOT 2
- Extra compiler flags HOT 1
- Fix for GCC warning HOT 1
- Perf regression HOT 8
- Performance differences between Windows and Linux HOT 4
- How can mimalloc manage a piece of allocated memory? HOT 3
- control over non-api symbol declarations HOT 10
- minject compatibility with mimalloc.dll
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mimalloc.