Re: [PATCH] git-compat-util: Avoid strcasecmp() being inlined
- From
Jeff King <peff@peff.net>
- Date
- Sep 24, 2013, 05:32 UTC
- Message-ID
- <20130924053230.GB5875@sigill.intra.peff.net>
- In-Reply-To
- <024f85fe-96e9-4201-8b3a-2e15c9da53e8@email.android.com>
On Fri, Sep 20, 2013 at 08:21:04AM +0200, Piotr Krukowiecki wrote:
Show 8 quoted lines
> >I can't think off-hand of a way to do so using preprocessor tricks, and > >even if we could, I suspect the result would end up quite ugly. > > What I meant was: can we add a test (in t/) which greps git source > code and fails if it finds strcasecmp string? > > It could count number of strcasecmp and expect to find only 1 or > exclude known location of the wrapper.
No, because it is perfectly fine (and desirable) to use strcasecmp as a function, just not as a function pointer. Telling the difference would involve minor parsing of C.
So I think the least bad thing is to simply catch it in review, or by testing on affected platforms.
-Peff