From: Junio C Hamano Date: Thu, 09 Jun 2016 19:19:31 GMT Subject: Re: [PATCH 1/2] submodule--helper: initial clone learns retry logic Message-ID: In-Reply-To: <20160609190637.21177-2-sbeller@google.com> Stefan Beller writes: > +static int compare_ce(const void *one, const void *two, void *cb_data) > +{ > + const struct cache_entry *ce_one = one, *ce_two = two; > + return ce_two - ce_one; > +} This would work in practice, but I suspect that this is not ANSI-C kosher; as address comparison for ordering (not equality) is undefined if two pointers are not pointing into the same array or into the same struct's fields. I think we have one or two other instances of such fishy pointer comparison already in the codebase, so it is not a show-stopper, but it would be better if this can be avoided and be replaced with something that I do not have to raise eyebrows at ;-)