Messages in this thread | | | Date | Wed, 26 Jan 2022 20:07:39 +0200 | From | Andy Shevchenko <> | Subject | Re: [PATCH v3 1/3] string: Make stpcpy() possible to use |
| |
On Wed, Jan 26, 2022 at 09:49:38AM -0800, Nick Desaulniers wrote: > On Wed, Jan 26, 2022 at 6:19 AM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > > > It is a good rule to avoid submitting code without users. > > Currently the stpcpy() is unusable due to missed declaration. > > Any attempts to use it will bring something like: > > > > error: implicit declaration of function ‘stpcpy’ [-Werror=implicit-function-declaration] > > > > Move declaration to the header and guard it as other string functions.
...
> Recall the discussion from Kees: > https://lore.kernel.org/lkml/CAK7LNAQXo5-5W6hvNMEVPBPf3tRWaf-pQdSR-0OHyi4RCGhjsQ@mail.gmail.com/ > and > https://lore.kernel.org/lkml/202008150921.B70721A359@keescook/
> I'm guessing that the 0day bot report was on the third patch in this > series, which looks to use stpcpy: > https://lore.kernel.org/lkml/20220126141917.75399-3-andriy.shevchenko@linux.intel.com/ > > for patch 3,
Yes. It was Rasmus' suggestion.
> I'd s/"compress"/de-duplicate/ or s/"compress"/merge/.
I'll fix it locally.
> Kees, I'm curious if we can do something like require the string > length to be known at compile time otherwise BUILD_BUG_ON?
Perhaps static_assert() is better.
-- With Best Regards, Andy Shevchenko
| |