Thread (1 message) 1 message, 1 author, 2020-04-23

Re: [PATCH 2/3] credential: teach `credential_from_url()` a non-strict mode

From: Junio C Hamano <hidden>
Date: 2020-04-23 22:11:31

Johannes Schindelin [off-list ref] writes:
Yes (modulo doing "greater than" comparison on pointers which is IIRC not
permitted in C in general).
Of course, people write a loop like this

	char *cp, *ep = strchr(string, '\n');

	for (cp = string; cp < ep; cp++)
		...

all the time, and forbidding pointer comparison would make the
language impossible to use ;-)

I think you are confused with a different rule---what is not kosher
is to compare two pointers that do not point into elements of the
same array.  Whether the comparison is done in (ptr1 < ptr2) way, or
(ptr2 - ptr1 < 0) way, does not change the equation.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help