Re: [PATCH v2 03/28] lib/string.c: implement stpcpy

2020-09-03 Thread Kees Cook
On Thu, Sep 03, 2020 at 01:30:28PM -0700, Sami Tolvanen wrote: > From: Nick Desaulniers > > LLVM implemented a recent "libcall optimization" that lowers calls to > `sprintf(dest, "%s", str)` where the return value is used to > `stpcpy(dest, str) - dest`. This generally avoids the machinery

[PATCH v2 03/28] lib/string.c: implement stpcpy

2020-09-03 Thread Sami Tolvanen
From: Nick Desaulniers LLVM implemented a recent "libcall optimization" that lowers calls to `sprintf(dest, "%s", str)` where the return value is used to `stpcpy(dest, str) - dest`. This generally avoids the machinery involved in parsing format strings. `stpcpy` is just like `strcpy` except it