Thread (4 messages) flat view 4 messages, 2 authors, 2016-06-15

Re: [PATCH] git-compat-util: Avoid strcasecmp() being inlined

From: Jeff King <hidden>
Date: 2016-06-15 22:58:51

On Thu, Sep 19, 2013 at 11:47:51AM +0200, Piotr Krukowiecki wrote:
quoted
quoted
quoted
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. It's
probably enough to just catch such problems in review, or let people on
affected systems report and fix the error if it slips through.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help