Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2018 13:33:31 -0700
From:      Devin Teske <dteske@FreeBSD.org>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Devin Teske <dteske@FreeBSD.org>, Alexey Dokuchaev <danfe@FreeBSD.org>, Michael Tuexen <tuexen@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:  <B15CF933-FD6E-4C5D-B3B5-B7AD4706EF40@FreeBSD.org>
In-Reply-To: <1532031535.1344.11.camel@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> <1532031535.1344.11.camel@freebsd.org>

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

> On Jul 19, 2018, at 1:18 PM, Ian Lepore <ian@freebsd.org> wrote:
>=20
> On Thu, 2018-07-19 at 13:12 -0700, Devin Teske wrote:
>>>=20
>>> On Jul 19, 2018, at 12:59 PM, Ian Lepore <ian@freebsd.org> wrote:
>>>=20
>>> On Thu, 2018-07-19 at 19:53 +0000, Alexey Dokuchaev wrote:
>>>>=20
>>>>>=20
>>>>> +++ 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=20
>>>=20
>>>  int a, *b;
>>>=20
>>> which, for maximal clarity, should be:
>>>=20
>>>   int  a;
>>>   int* b;
>>>=20
>> Are we free to prefer the former in C if that's how we've been coding =
in C for 20+ years?
>=20
> Only if I'm free to consider that kind of sarcasm to be a completely
> inappropriate response to what I said.
>=20

I sincerely believe you when you say you've worked at places that use =
"int* b".

I use "int *b;" and I want to know if I am free to use that for the =
stated reasons.
--=20
Devin=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B15CF933-FD6E-4C5D-B3B5-B7AD4706EF40>