Hacker News new | ask | show | jobs
by stephanimal 2215 days ago
Because it is a function in the C Standard Library. Programs are typically prohibited from declaring these functions. You can if you don't link with libc and pass in the correct compiler flags (gcc will turn some raw loops into a memcpy call as an optimization even without linking libc afaik)

https://www.gnu.org/software/libc/manual/html_node/Reserved-...

1 comments

Compilation units are required to declare all standard library functions they call. They usually do so by including the compiler's header files rather than doing more work and risk errors with explicit declarations.