3 ms·
While I'm perfectly fine with this commit-essay, and would probably be with any other, in this particular case I would also be perfectly fine with a terse "ban
by temac 7y ago
While I'm perfectly fine with this commit-essay, and would probably be with any other, in this particular case I would also be perfectly fine with a terse "ban strcpy" + actually a few more comments in the source code.
Commit messages are not going to serve as a knowledge base for state of the art and best practices, and strcpy is universally recognized as problematic. Plus, about the how, while it is fine to see the dev thought a lot about it, did some testing, etc., the way he did the ban is ultra classic in the end. Also, it might have been even better to put some short explanations in comments instead of in just the commit message, in particular the usefulness of the BANNED macro to preserve some line numbers with gcc. So in this particular case I'm not really convinced that the commit message serves any strong purpose.
But it does not hurt. And it participates to a culture where useful commit messages are important. So I still (weakly) prefer it to my hypothetical "ban strcpy".