Re: [PATCH 1/2] introduce "banned function" list
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 20, 2018, 09:32 UTC
- Message-ID
- <xmqqa7qmckwi.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180720010808.GC2179@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
>> Is it a downside that it is cumbersome to override? This is not a >> rhetorical question. I am not convinced there will not be a legit >> circumstance that calling strcpy (or whatever we are going to ban) >> is the best solution and it is safe. By "best", what I mean is "you >> could instead use memcpy/strncpy/whatever" can legitimately be >> argued with "but still using memcpy/strncpy/whatever is inferior >> than using strcpy in this case for such and such reasons". > > In my opinion, no, this is not a problem. > > My plan is to only add functions which are truly worthless.
OK.
> Contrast this with memcpy(). This is on Microsoft's SDL banned list[1], > but I think it's silly for it to be. I would never add it to this list.
A tangent, but is that because they want you to use memmove() instead so that you do not have to worry about overlapping copies, perhaps?