Subject: Re: commoning up code that changes uids and gids
From: David Laight <firstname.lastname@example.org>
Date: 04/05/2003 22:39:24
> > for instance how would you read:
> > svuid = 1 + (ruid == p->p_cred->p_ruid) ? -1 : euid;
> In the first place, I'd write this as
> svuid = 1 + ((ruid == p->p_cred->p_ruid) ? -1 : euid);
> and thus would not have any problem reading it. Parenthesis good.
I thought you might :-) which indicates that the parenthesis confused you!
Learn table 2-1 (P53 of K&R 2), it isn't hard.
Personally I find that, in complex expressions, unnecessary parenthesis
make parsing harder not easier. The () around the first operand of ?:
are particulaly pointless, as are those the the RHS of = (and other
After all you don't use () around ->  and .
David Laight: email@example.com