Source-Changes-D archive

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

Re: CVS commit: src/share/misc



On 31.03.2021 11:03, Robert Elz wrote:
Here, as I recall it, the issue only arose because of something either
lint or indent was doing, or wanted to do.   I don't recall which, but
I do not remember any earlier complaints from anyone that they couldn't
understand code because of missing () around a variable name arg to sizeof.

It was neither lint nor indent that did anything, it was just me editing
the lint code.

I had removed the parentheses where not required by the syntax since I
felt them to be misleading since these parentheses are not part of a
function call expression but are instead just the usual parentheses for
grouping expressions.

I had read share/misc/style before, but interpreted it differently,
thinking that it only preferred 'sizeof(x)' over 'sizeof (x)' and that
this guideline would not say anything about whether there should be
parentheses or not.

For simple cases I agree with Matthew that parentheses should not be
required.  Looking through the src tree, I noticed though that the vast
majority of the code uses the redundant parentheses, so I also agree
with Christos that it's good to have a simple rule.

Roland


Home | Main Index | Thread Index | Old Index