tech-userlevel archive

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

Re: CVS commit: src/share/misc



In article <6734.1617154700%splode.eterna.com.au@localhost>,
matthew green  <mrg%eterna.com.au@localhost> wrote:
>Christos Zoulas writes:
>> In article <20900.1616977358%splode.eterna.com.au@localhost>,
>> matthew green  <mrg%eterna.com.au@localhost> wrote:
>> >> Log Message:
>> >> Clarify and explain the rationale for parentheses in sizeof and return as
>> >> discussed.
>> >
>> >+        * a function call. We always parenthesize the sizeof expression for
>> >+        * consistency.
>> >
>> >i object.  this discussion was not finished.
>>
>> Ok, please provide an alternative proposal.
>
>i already did in the other thread -- apply the existing
>() rule.  aka, avoid it unless it helps comprehension,
>which means simple sizeof can avoid it, but anything
>slightly complex should not.  this means that all the
>fun cases will use () and the specific case i won't use
>it for is left alone (snprintf(buf, sizeof buf, ...)).

There are 3 x 'sizeof(' in the tree compared to 'sizeof ' in '*.c' and
I am counting 'sizeof (' as 'sizeof ':

191337 'sizeof('
 63508 'sizeof '

I think that it is better to bless the prevailing majority as the rule,
but we should let others express their opinions first.

Best,

christos


Home | Main Index | Thread Index | Old Index