Re: [PATCH 1/2] submodule--helper: initial clone learns retry logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stefan Beller <sbeller@xxxxxxxxxx> 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 ;-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]