Re: [PATCH v2 1/4] automatically ban strcpy()

2018-07-26 Thread Jeff King
On Tue, Jul 24, 2018 at 01:20:58PM -0400, Eric Sunshine wrote: > On Tue, Jul 24, 2018 at 5:26 AM Jeff King wrote: > > 1. We'll only trigger with -Wimplicit-function-declaration > > (and only stop compilation with -Werror). These are > > generally enabled by DEVELOPER=1. If you

Re: [PATCH v2 1/4] automatically ban strcpy()

2018-07-24 Thread Eric Sunshine
On Tue, Jul 24, 2018 at 5:26 AM Jeff King wrote: > 1. We'll only trigger with -Wimplicit-function-declaration > (and only stop compilation with -Werror). These are > generally enabled by DEVELOPER=1. If you _don't_ have > that set, we'll still catch the problem, but only at >

[PATCH v2 1/4] automatically ban strcpy()

2018-07-24 Thread Jeff King
There are a few standard C functions (like strcpy) which are easy to misuse. E.g.: char path[PATH_MAX]; strcpy(path, arg); may overflow the "path" buffer. Sometimes there's an earlier constraint on the size of "arg", but even in such a case it's hard to verify that the code is correct. If