Re: [PATCH] git-compat-util: Avoid strcasecmp() being inlined
Jeff King <peff@peff.net> napisał:
Show 22 quoted lines
>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