From: Piotr Krukowiecki Date: Fri, 20 Sep 2013 06:21:04 GMT Subject: Re: [PATCH] git-compat-util: Avoid strcasecmp() being inlined Message-ID: <024f85fe-96e9-4201-8b3a-2e15c9da53e8@email.android.com> In-Reply-To: <20130919211659.GB16556@sigill.intra.peff.net> Jeff King napisaƂ: >On Thu, Sep 19, 2013 at 11:47:51AM +0200, Piotr Krukowiecki wrote: > >> >> > it still ends up as a single function call). The downside is >that it has >> >> > to be remembered at each site that uses strcasecmp, but we do >not use >> >> > pointers to standard library functions very often. >> >> >> >> Is it possible to add a test which fails if wrapper is not used? >> > >> > No test needed for this, as compilation or linkage will fail, I >think. >> >> But only when someone compiles on MinGW, no? > >Yeah. I think a more clear way to phrase the question would be: is >there >some trick we can use to booby-trap strcasecmp as a function pointer so >that it fails to compile even on systems where it would otherwise work? > >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. -- Piotr Krukowiecki