On 9/29/2021 9:32 AM, Luís Ferreira wrote:
This may be optimized by some modern smart compilers inliner, but since
strlen can be an external source, this can produce unoptimized code.
strlen has very well defined semantics by ISO and even if it's defined
externally compilers know those semantics and can optimize
appropriately. In fact, if you build a testcase, compile it with a
modern compiler, you should see the call to strlen optimized away & the
call to memcpy turned into a simple store.
So I just don't see the value in adding more code here when we can just
let the optimizer do its job and get the same result.
I won't object if Iain wants to go forward with this patch, but I'm not
going forward with it independently.
jeff