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

Alexey Dokuchaev danfe at FreeBSD.org
Thu Jul 19 20:19:42 UTC 2018


On Thu, Jul 19, 2018 at 01:12:19PM -0700, Devin Teske wrote:
> > On Jul 19, 2018, at 12:59 PM, Ian Lepore <ian at freebsd.org> wrote:
> > ...
> > "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

This is often true for C++ (partially because it has both * and &), but...

> > 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?

I agree with Devin here: we, in FreeBSD, which is mostly coded in C, place
the star by the variable rather than its type.

./danfe


More information about the svn-src-head mailing list