In ucrt64, quick_exit is not found.

#include <cstdlib>
int main()
{
        std::quick_exit(0);
}

$g++ -o fail1.exe -std=c++11 -Wall -Wextra -pedantic fail1.cpp
fail1.cpp: In function 'int main()':
fail1.cpp:4:7: error: 'quick_exit' is not a member of 'std'
    4 |  std::quick_exit(0);
      |       ^~~~~~~~~~


#include <stdlib.h>
int main(void)
{
        quick_exit(0);
}

$gcc -o fail2.exe -std=c11 -Wall -Wextra -pedantic fail2.c
fail2.c: In function 'main':
fail2.c:4:2: warning: implicit declaration of function 'quick_exit' 
[-Wimplicit-function-declaration]
    4 |  quick_exit(0);
      |  ^~~~~~~~~~


However, ucrt runtime provides it so that when I manually add declaration, I 
can use it.

extern "C" [[noreturn]] void quick_exit(int) noexcept;
int main()
{
        quick_exit(0);
}

$g++ -o main.exe -std=c++11 -Wall -Wextra -pedantic main.cpp
$./main.exe


In cstdlib header, we can find the declaration but it is for a free-standing 
environment or using quick_exit of the global namespace.

$cat -n /ucrt64/include/c++/10.2.0/cstdlib | head -n 66 | tail -n 3
    64  # ifdef _GLIBCXX_HAVE_QUICK_EXIT
    65    extern "C" void quick_exit(int) throw() _GLIBCXX_NORETURN;
    66  # endif
$cat -n /ucrt64/include/c++/10.2.0/cstdlib | head -n 161 | tail -n 3
   159  # ifdef _GLIBCXX_HAVE_QUICK_EXIT
   160    using ::quick_exit;
   161  # endif


And I cannot find the global quick_exit declaration.

$cat -n /ucrt64/x86_64-w64-mingw32/include/stdlib.h | grep quick_exit


So, even though I manually define _GLIBCXX_HAVE_QUICK_EXIT macro, I can't use 
that.

Is there any place tracing this issue?

note: This issue was transferred from 
https://github.com/msys2/MINGW-packages/issues/8425

--
yumetodo <[email protected]>

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to