4 ms·
The mem functions are available as compiler built-ins, no need for libc.
by mgaunard 4y ago
The mem functions are available as compiler built-ins, no need for libc.
- Karellen 4y agoWell, that depends on your compiler.
- mgaunard 4y agoGCC is the standard.
- Karellen 4y agoHuh. Last time I looked at the standard, I didn't see where that was mentioned. Could you point me at the relevant section, please?
- mgaunard 4y agoYou don't appear to understand what the word standard means.
- beached_whale 4y agoIt's called GNU/C Standard /jk
- flohofwoe 4y agoNot on Windows or Mac.
- mgaunard 4y agoThe platform compiler on Mac is Clang, which is specifically designed to be GCC-compatible, because GCC is the industry standard.
- flohofwoe 4y ago*rolls eyes* 1. There is no "industry standard" for C compilers, for instance in the game dev world, the closest thing to an "industry standard compiler" is MSVC, and not GCC or Clang. 2. While Clang tries to emulate some GCC-isms, it also has important differences to GCC. On Windows, Clang also emulates a lot of MSVC-isms, so emulating GCC really doesn't mean anything.*
- mgaunard 4y agoMicrosoft explicitly considers C legacy, and offer a C++ compiler instead.
- dezgeg 4y agoNo. While the compiler can optimize memcpy calls to direct loads/stores for small arguments (when inlining the loads/stores would be smaller than the cost of calling memcpy), for bigger or not statically know sizes it WILL call to memcpy in libc. And in fact it may even emit memcpy calls for things like struct copies.
- mgaunard 4y agowhether you want the built-in to have the ability to refer to an external definition is a compiler flag.