svn commit: r336503 - in head/sys: netinet netinet6

Ian Lepore ian at freebsd.org
Thu Jul 19 20:19:03 UTC 2018


On Thu, 2018-07-19 at 13:12 -0700, Devin Teske wrote:
> > 
> > On Jul 19, 2018, at 12:59 PM, Ian Lepore <ian at 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?

Only if I'm free to consider that kind of sarcasm to be a completely
inappropriate response to what I said.

-- Ian


More information about the svn-src-all mailing list