On Sat, Jun 29, 2019 at 06:15:37PM +0200, Stephen Kitt wrote: > On Fri, 28 Jun 2019 17:25:48 +0530, Nitin Gote <nitin.r.gote@xxxxxxxxx> wrote: > > 1. Deprecate strcpy() in favor of strscpy(). > > This isn’t a comment “against” this patch, but something I’ve been wondering > recently and which raises a question about how to handle strcpy’s deprecation > in particular. There is still one scenario where strcpy is useful: when GCC > replaces it with its builtin, inline version... > > Would it be worth introducing a macro for strcpy-from-constant-string, which > would check that GCC’s builtin is being used (when building with GCC), and > fall back to strscpy otherwise? How would you suggest it operate? A separate API, or something like the existing overloaded strcpy() macros in string.h? -- Kees Cook