logoalt Hacker News

SkiFire13today at 6:18 PM1 replyview on HN

> I wish compilers would just have something like __builtin_memcpy and __builtin_memset

The ones provided by the compilers are simply the libc ones.

LLVM will even go as far as detect attempts to rewrite memcpy and replace them with a call to the libc one!


Replies

wren6991today at 6:26 PM

Even if the attempt is inside of a function called memcpy() which contains no code other than your copy loop, and links with priority over the libc implementation! (as all embedded firmware engineers learn at some point in their journey)