The compiler doesn't know the implementation of strlen, it only has its header. At runtime it might be different than at compile time (e.g. LD_PRELOAD=...). For this to be optimized you need link time optimization.
Why?
What happens if it isn't?
If you want a dialect where they aren't allowed to assume that you would have to make your own
memcpy will get transformed and inlined for small copies all the time.
But the orthodox answer to such questions is that demons fly out of your nose.
§6.4.2.1: "If the program defines a reserved identifier [...] the behavior is undefined."
This is the case, for example, on macOS, FreeBSD, and Linux.
Cute username, BTW.
> Cute username, BTW.
Thanks, I was to lazy to think of a real name, so this is the timestamp, I created the account.
BTW, the case of it not optimizing was MSVC targetting Windows (which doesn't support LD_PRELOAD, but maybe has something similar?).