Source-Changes-D archive

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

Re: The --> "operator"



Roland Illig <roland.illig%gmx.de@localhost> writes:

> Am 07.07.2026 16:08:00 schrieb Taylor R Campbell :
>
>>> Date: Mon, 6 Jul 2026 00:14:59 +0900
>>> From: Takashi YAMAMOTO <yamt9999%gmail.com@localhost>
>>>
>>> @@ -900,7 +897,7 @@ uvm_swap_stats(char *ptr, int misc,
>>>         error = 0;
>>>         count = 0;
>>>         sp = sdps;
>>> -       while (misc-- > 0) {
>>> +       while (misc --> 0) {
>>>
>>> this style change is quite surprising to me. it it intentional?
>>
>> This is the best operator in C!  --> is the `goes down to' operator.
>
> How does it come that this "best operator" is neither mentioned in operator(7) nor share/misc/style, and that indent(1) formats it as two separate operators? All this looks like you're making things up.
>
> If you decide that this style is superior, you should adjust the aforementioned places (there may be more) and apply this style change throughout the whole source tree, for consistency.

I have never seen --> in C, from reading K&R in 1977 to now.  It looks
like something made up by C++ :-) But seriously, I find it unhelpful.
The semantics of --i and i-- are clear and have been stable for years,
as are the semantics of > and >=.

I would like to see our style guide say explicitly that --> is not
allowed.


Home | Main Index | Thread Index | Old Index