Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > muc.lists.netbsd.source-changes > #156202

Re: The --> "operator"

From Greg Troxel <gdt@lexort.com>
Newsgroups muc.lists.netbsd.source-changes
Subject Re: The --> "operator"
Date 2026-07-08 06:56 -0400
Organization Newsgate at muc.de e.V.
Message-ID <rmizf0121j2.fsf@s1.lexort.com> (permalink)
References <> <4cd210f2-f070-4c2c-bbe4-3184e0e8d8d5@gmx.de>

Show all headers | View raw


Roland Illig <roland.illig@gmx.de> 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>
>>>
>>> @@ -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.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de

Back to muc.lists.netbsd.source-changes | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: The --> "operator" Greg Troxel <gdt@lexort.com> - 2026-07-08 06:56 -0400
  Re: The --> "operator" Martin Husemann <martin@duskware.de> - 2026-07-08 13:38 +0200
    Re: The --> "operator" Greg Troxel <gdt@lexort.com> - 2026-07-08 07:44 -0400
      Re: The --> "operator" "Jonathan A. Kollasch" <jakllsch@kollasch.net> - 2026-07-09 20:58 -0500

csiph-web