Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2023 08:24:33 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Kyle Evans <kevans@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: 2ffdc21324bd - main - config: make changes to allow some parts to build as C++
Message-ID:  <CANCZdfrYZDAtnbmtBcw0UbHfb7modAs-LJ0TLNra2kxdSZu0aA@mail.gmail.com>
In-Reply-To: <CACNAnaFt_hN14fA1CGfyppzvscG2P2gJiXv102GuzmVZhH-kNw@mail.gmail.com>
References:  <202302080610.3186ANQd091168@gitrepo.freebsd.org> <Y%2BOfyRZgTcUzcDcf@kib.kiev.ua> <CACNAnaFt_hN14fA1CGfyppzvscG2P2gJiXv102GuzmVZhH-kNw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000002ceb7d05f431dd32
Content-Type: text/plain; charset="UTF-8"

On Wed, Feb 8, 2023, 8:09 AM Kyle Evans <kevans@freebsd.org> wrote:

> On Wed, Feb 8, 2023 at 7:12 AM Konstantin Belousov <kostikbel@gmail.com>
> wrote:
> >
> > On Wed, Feb 08, 2023 at 06:10:23AM +0000, Kyle Evans wrote:
> > > The branch main has been updated by kevans:
> > >
> > > URL:
> https://cgit.FreeBSD.org/src/commit/?id=2ffdc21324bd1772fa2f40efed3987afecabf5cb
> > >
> > > commit 2ffdc21324bd1772fa2f40efed3987afecabf5cb
> > > Author:     Kyle Evans <kevans@FreeBSD.org>
> > > AuthorDate: 2023-02-08 06:02:56 +0000
> > > Commit:     Kyle Evans <kevans@FreeBSD.org>
> > > CommitDate: 2023-02-08 06:09:10 +0000
> > >
> > >     config: make changes to allow some parts to build as C++
> > >
> > >     Highlights:
> > >     - Avoid keywords (this, not) as variable names
> > >     - Move yyparse into config.h with other declarations
> > >     - All declarations in config.h are assumed guilty until proven
> innocent
> > >     - Some const-correctness
> > >     - Casting malloc/calloc returns
> > >
> > >     Note that we're not building any C++ here yet, this will be
> introduced
> > >     in other commits to replace some of the lib dependencies.
> Reducing the
> > >     number of FreeBSD-specific dependencies we have reduces some
> friction
> > >     for building our bootstrap tools independently in other
> environments.
> > >
> > >     Reviewed by:    imp
> > >     Sponsored by:   Klara, Inc.
> > >     Sponsored by:   NetApp, Inc.
> > >     Differential Revision:  https://reviews.freebsd.org/D38274
> > > ---
> > >  usr.sbin/config/config.h     |  6 ++++++
> > >  usr.sbin/config/main.c       | 19 ++++++++++---------
> > >  usr.sbin/config/mkmakefile.c | 44
> ++++++++++++++++++++++----------------------
> > >  usr.sbin/config/mkoptions.c  | 28 ++++++++++++++--------------
> > >  4 files changed, 52 insertions(+), 45 deletions(-)
> > >
> > > diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
> > > index 79d0a788bae7..7d97d66979e2 100644
> > > --- a/usr.sbin/config/config.h
> > > +++ b/usr.sbin/config/config.h
> > > @@ -35,12 +35,15 @@
> > >  /*
> > >   * Config.
> > >   */
> > > +#include <sys/cdefs.h>       /* __BEGIN_DECLS/__END_DECLS */
> > But sys/types.h already includes sys/cdefs.h (as most of our headers).
> >
>
> Indeed, I couldn't recall if we can/should rely on the implicit
> inclusion or not and added it anyways. I'll fold removal into the last
> config(8) change along these lines[0], which I'll probably land
> tonight if I don't get any major complaints from the ones I've already
> landed.
>

Sounds good. I meant to give feedback on that then got the creeping crude
for a couple of days.  I was going to make the same suggestion since I
asked in the review .

Warner


> Thanks,
>
> Kyle Evans
>
> [0] https://reviews.freebsd.org/D38276
>

--0000000000002ceb7d05f431dd32
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Wed, Feb 8, 2023, 8:09 AM Kyle Evans &lt;<a href=3D=
"mailto:kevans@freebsd.org">kevans@freebsd.org</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">On Wed, Feb 8, 2023 at 7:12 AM Konstantin Belous=
ov &lt;<a href=3D"mailto:kostikbel@gmail.com" target=3D"_blank" rel=3D"nore=
ferrer">kostikbel@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Wed, Feb 08, 2023 at 06:10:23AM +0000, Kyle Evans wrote:<br>
&gt; &gt; The branch main has been updated by kevans:<br>
&gt; &gt;<br>
&gt; &gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D2ffdc21=
324bd1772fa2f40efed3987afecabf5cb" rel=3D"noreferrer noreferrer" target=3D"=
_blank">https://cgit.FreeBSD.org/src/commit/?id=3D2ffdc21324bd1772fa2f40efe=
d3987afecabf5cb</a><br>
&gt; &gt;<br>
&gt; &gt; commit 2ffdc21324bd1772fa2f40efed3987afecabf5cb<br>
&gt; &gt; Author:=C2=A0 =C2=A0 =C2=A0Kyle Evans &lt;kevans@FreeBSD.org&gt;<=
br>
&gt; &gt; AuthorDate: 2023-02-08 06:02:56 +0000<br>
&gt; &gt; Commit:=C2=A0 =C2=A0 =C2=A0Kyle Evans &lt;kevans@FreeBSD.org&gt;<=
br>
&gt; &gt; CommitDate: 2023-02-08 06:09:10 +0000<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0config: make changes to allow some parts to bu=
ild as C++<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Highlights:<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0- Avoid keywords (this, not) as variable names=
<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0- Move yyparse into config.h with other declar=
ations<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0- All declarations in config.h are assumed gui=
lty until proven innocent<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0- Some const-correctness<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0- Casting malloc/calloc returns<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Note that we&#39;re not building any C++ here =
yet, this will be introduced<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0in other commits to replace some of the lib de=
pendencies.=C2=A0 Reducing the<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0number of FreeBSD-specific dependencies we hav=
e reduces some friction<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0for building our bootstrap tools independently=
 in other environments.<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 imp<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Klara, Inc.<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0NetApp, Inc.<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 <a href=3D"https:=
//reviews.freebsd.org/D38274" rel=3D"noreferrer noreferrer" target=3D"_blan=
k">https://reviews.freebsd.org/D38274</a><br>;
&gt; &gt; ---<br>
&gt; &gt;=C2=A0 usr.sbin/config/config.h=C2=A0 =C2=A0 =C2=A0|=C2=A0 6 +++++=
+<br>
&gt; &gt;=C2=A0 usr.sbin/config/main.c=C2=A0 =C2=A0 =C2=A0 =C2=A0| 19 +++++=
+++++---------<br>
&gt; &gt;=C2=A0 usr.sbin/config/mkmakefile.c | 44 ++++++++++++++++++++++---=
-------------------<br>
&gt; &gt;=C2=A0 usr.sbin/config/mkoptions.c=C2=A0 | 28 ++++++++++++++------=
--------<br>
&gt; &gt;=C2=A0 4 files changed, 52 insertions(+), 45 deletions(-)<br>
&gt; &gt;<br>
&gt; &gt; diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h<=
br>
&gt; &gt; index 79d0a788bae7..7d97d66979e2 100644<br>
&gt; &gt; --- a/usr.sbin/config/config.h<br>
&gt; &gt; +++ b/usr.sbin/config/config.h<br>
&gt; &gt; @@ -35,12 +35,15 @@<br>
&gt; &gt;=C2=A0 /*<br>
&gt; &gt;=C2=A0 =C2=A0* Config.<br>
&gt; &gt;=C2=A0 =C2=A0*/<br>
&gt; &gt; +#include &lt;sys/cdefs.h&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/* __BEGI=
N_DECLS/__END_DECLS */<br>
&gt; But sys/types.h already includes sys/cdefs.h (as most of our headers).=
<br>
&gt;<br>
<br>
Indeed, I couldn&#39;t recall if we can/should rely on the implicit<br>
inclusion or not and added it anyways. I&#39;ll fold removal into the last<=
br>
config(8) change along these lines[0], which I&#39;ll probably land<br>
tonight if I don&#39;t get any major complaints from the ones I&#39;ve alre=
ady<br>
landed.<br></blockquote></div></div><div dir=3D"auto"><br></div><div dir=3D=
"auto">Sounds good. I meant to give feedback on that then got the creeping =
crude for a couple of days.=C2=A0 I was going to make the same suggestion s=
ince I asked in the review .=C2=A0</div><div dir=3D"auto"><br></div><div di=
r=3D"auto">Warner</div><div dir=3D"auto"><br></div><div dir=3D"auto"><div c=
lass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
<br>
Kyle Evans<br>
<br>
[0] <a href=3D"https://reviews.freebsd.org/D38276" rel=3D"noreferrer norefe=
rrer" target=3D"_blank">https://reviews.freebsd.org/D38276</a><br>;
</blockquote></div></div></div>

--0000000000002ceb7d05f431dd32--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrYZDAtnbmtBcw0UbHfb7modAs-LJ0TLNra2kxdSZu0aA>