bug-standards
[Top][All Lists]
Advanced

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

Re: indentation uncertainty


From: Alexandre Oliva
Subject: Re: indentation uncertainty
Date: Tue, 13 Feb 2018 12:24:36 -0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

On Feb  9, 2018, address@hidden (Alfred M. Szmidt) wrote:

>> return rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
>> + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;

>> I'd consider this improper, since it puts the operator where it
>> doesn't belong

>    Why does not belong IYHO?

> The coding standards recommend that the expression follows below it
> self.

Where?

> That is, we don't write:

>   mode = inmode[j] == VOIDmode
>     || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])
>     ? outmode[j] : inmode[j];

Actually, some people do break the line before the || and indent it just
like that.  That would show exactly the point of contention I've raised,
if it weren't for the '?' on the next line, that places operators of
different precedences at the same alignment.

> I don't see the difference between "mode =", sizeof, or return.

Indeed, there doesn't seem to be reason to distinguish between e.g.:

  return inmode[j] == VOIDmode
    || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]);

or 

  bool var = inmode[j] == VOIDmode
    || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j]);

> clarification cannot hurt. :-)

:-)

>    Now, given that there is disagreement even here, I wonder if this is the
>    proper forum to determine what the fix to the recommendation should be.
>    Should I take it elsewhere, or is this the right forum to debate what
>    the GNU general recommendation should be?

> This is probobly the right forum, I would suggest maybe adding
> addition examples, or maybe simply mentioning that the same rules
> apply for sizeof/return/... 

Should I wait till we sort out the disagreement before proposing patches
for the standard, or should I propose a patch that states what I think
it was always meant to be?

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]