Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2018 16:29:09 -0400
From:      Michael Tuexen <tuexen@freebsd.org>
To:        Devin Teske <dteske@FreeBSD.org>
Cc:        Ian Lepore <ian@freebsd.org>, Alexey Dokuchaev <danfe@FreeBSD.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r336503 - in head/sys: netinet netinet6
Message-ID:  <7B5E13F1-A134-4762-BEC3-99FB3306621A@freebsd.org>
In-Reply-To: <06745A7A-2E1C-4E48-ADCE-F42447B28A2C@FreeBSD.org>
References:  <201807191933.w6JJXhof018383@repo.freebsd.org> <20180719195302.GA26853@FreeBSD.org> <1532030389.1344.9.camel@freebsd.org> <06745A7A-2E1C-4E48-ADCE-F42447B28A2C@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> On 19. Jul 2018, at 16:12, Devin Teske <dteske@FreeBSD.org> wrote:
> 
> 
>> On Jul 19, 2018, at 12:59 PM, Ian Lepore <ian@freebsd.org> wrote:
>> 
>> On Thu, 2018-07-19 at 19:53 +0000, Alexey Dokuchaev wrote:
>>>> +++ head/sys/netinet/sctp_asconf.c    Thu Jul 19 19:33:42 2018        (r336503)
>>>>  static struct mbuf *
>>>> -sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t *error_tlv,
>>>> +sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * error_tlv,
>>> 
>>> This looks strange now.  In C, asterisk is usually placed by the variable.
>> 
>> "usually" may be true of freebsd, but most places I've worked consider
>> the * (and & in c++) to be more associated with the type being declared
>> than with the variable name, thus they get snugged up against the type
>> info, not the var name. Putting the * or & with the var name leads to
>> particularly bad constructs such as 
>> 
>> int a, *b;
>> 
>> which, for maximal clarity, should be:
>> 
>>  int  a;
>>  int* b;
>> 
> 
> Are we free to prefer the former in C if that's how we've been coding in C for 20+ years?
The code you see is a result of running a formatting tool based on ident
on code supporting a variety of platforms. Since ident has changed recently
I wanted to commit the corresponding whitespace changes separately, but
used an older parametrisation of the script. So I reverted it in
https://svnweb.freebsd.org/changeset/base/336508
and committed the correct version in
https://svnweb.freebsd.org/changeset/base/336511

Best regards
Michael
> -- 
> Devin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7B5E13F1-A134-4762-BEC3-99FB3306621A>