C ++ autonomous functions

What features can I use in a standalone C ++ environment? I am developing a small kernel (for my own pleasure), and I know that I cannot use the entire stdlib library, but what else? when I tried to use the new and deleted operators, which he compiled without problems, but the linker said

undefined reference to `operator new[](unsigned long)
undefined reference to `operator delete[](void*)'

I am contacting the parameters -lgccand -lsupc++. I know that exception handling is disabled offline, but I'm a little surprised that new and deleted too. So what can I use and what not?

+4
source share
1 answer

What features can I use in a standalone C ++ environment?

:

[intro.compliance]... - , , ,

[intro.multithread]... , , .

[basic.start.main] , . [. ; - up ; . - ]

[using.headers] ++

<ciso646>
<cstddef>
<cfloat>
<limits>
<climits>
<cstdint>
<cstdlib>
<new>
<typeinfo>
<exception>
<initializer_list>
<cstdalign>
<cstdarg>
<cstdbool>
<atomic>

[] <cstdlib> , , abort, atexit, at_quick_- exit, exit quick_exit (18.5). , , .

, malloc/free <cstdlib>.


, , :

[replacement.functions] ++ <new>

, , malloc , , , . , .

+6

Source: https://habr.com/ru/post/1670759/


All Articles