Giter Club home page Giter Club logo

Comments (15)

nxrighthere avatar nxrighthere commented on August 19, 2024

For the first one you can just include <errno.h>, it should fix this.

from mimalloc.

degski avatar degski commented on August 19, 2024

@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.

aleksmelnikov avatar aleksmelnikov commented on August 19, 2024

Some information about the problem:
https://stackoverflow.com/questions/15466613/lowercase-windows-h-and-uppercase-windows-h-difference

from mimalloc.

degski avatar degski commented on August 19, 2024

@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.

daanx avatar daanx commented on August 19, 2024

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.

aleksmelnikov avatar aleksmelnikov commented on August 19, 2024

@daanx , yes it's compiled now (with patch #22). Thx.

from mimalloc.

nxrighthere avatar nxrighthere commented on August 19, 2024

@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.

aleksmelnikov avatar aleksmelnikov commented on August 19, 2024

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.

daanx avatar daanx commented on August 19, 2024

@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.

nxrighthere avatar nxrighthere commented on August 19, 2024

@daanx Strange, FlsAlloc/FlsSetValue implicit declaration warnings are still there while the appropriate header is included now. 🤔

from mimalloc.

nxrighthere avatar nxrighthere commented on August 19, 2024

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.

viccpp avatar viccpp commented on August 19, 2024

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.

daanx avatar daanx commented on August 19, 2024

Fixed the format specifiers in commit f36149a. Thanks everyone.

from mimalloc.

daanx avatar daanx commented on August 19, 2024

Can we close this issue?

from mimalloc.

nxrighthere avatar nxrighthere commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.