Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jan 2025 11:10:54 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Alan Somers <asomers@freebsd.org>
Cc:        Dimitry Andric <dim@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: What's the newest C++ standard that we can target?
Message-ID:  <CANCZdfqc3b=1AeoAcDGcOkD64o6LKrk56FDUnqbSx6f5DFcdRg@mail.gmail.com>
In-Reply-To: <CAOtMX2gNMSkusKi0ZV3W1Zuu9aNots16_huZNjktJa4L2hnaBg@mail.gmail.com>
References:  <CAOtMX2hCM3BEK%2B4ydw8g2R7b=T_TR6U4YRXpDbFijD52y=jA8g@mail.gmail.com> <4F5BB7D7-94F6-46D2-B467-4E51991311BE@FreeBSD.org> <CAOtMX2gNMSkusKi0ZV3W1Zuu9aNots16_huZNjktJa4L2hnaBg@mail.gmail.com>

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

[-- Attachment #1 --]
On Wed, Jan 8, 2025, 10:47 AM Alan Somers <asomers@freebsd.org> wrote:

> On Wed, Jan 8, 2025 at 10:44 AM Dimitry Andric <dim@freebsd.org> wrote:
> >
> > On 8 Jan 2025, at 18:31, Alan Somers <asomers@freebsd.org> wrote:
> > >
> > > What is the newest C++ standard that we can target in src, and be
> > > confident that it will compile on all targets?  Can we use C++20?
> >
> > C++17 is probably the safest one, as C++20 support in libc++ 19 is
> > mostly done, but not entirely complete:
> >
> > https://libcxx.llvm.org/Status/Cxx20.html
> >
> > As long as you avoid modules, and the more exotic parts, you should be
> > fine. One glaring remaining issue is that std::jthread support is still
> > gated under -fexperimental-library, at least until libc++ 20 comes out.
> >
> > That said, older existing releases don't have libc++ 19 yet, and they
> > are missing a few headers too. So it depends on whether you want to
> > target -CURRENT only?
> >
> > -Dimitry
>
> I guess I should've mentioned that I would like to MFC to stable/14,
> too.  I certainly intend to avoid exotic parts.  Is there any better
> way to ensure that may code will build other than "make universe"?
>

No.

But I keep a stable/13 and stable/14 trees around that I build on amd64 and
armv7 for all changes unless I'm worried. It's faster. Another way is to
have jails for these environments for incremental development or quick
experiments. Poudriere is a good way to build those jails quickly.

Warner

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 8, 2025, 10:47 AM Alan Somers &lt;<a href="mailto:asomers@freebsd.org" target="_blank" rel="noreferrer">asomers@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Jan 8, 2025 at 10:44 AM Dimitry Andric &lt;<a href="mailto:dim@freebsd.org" rel="noreferrer noreferrer" target="_blank">dim@freebsd.org</a>&gt; wrote:<br>
&gt;<br>
&gt; On 8 Jan 2025, at 18:31, Alan Somers &lt;<a href="mailto:asomers@freebsd.org" rel="noreferrer noreferrer" target="_blank">asomers@freebsd.org</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; What is the newest C++ standard that we can target in src, and be<br>
&gt; &gt; confident that it will compile on all targets?  Can we use C++20?<br>
&gt;<br>
&gt; C++17 is probably the safest one, as C++20 support in libc++ 19 is<br>
&gt; mostly done, but not entirely complete:<br>
&gt;<br>
&gt; <a href="https://libcxx.llvm.org/Status/Cxx20.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://libcxx.llvm.org/Status/Cxx20.html</a><br>;
&gt;<br>
&gt; As long as you avoid modules, and the more exotic parts, you should be<br>
&gt; fine. One glaring remaining issue is that std::jthread support is still<br>
&gt; gated under -fexperimental-library, at least until libc++ 20 comes out.<br>
&gt;<br>
&gt; That said, older existing releases don&#39;t have libc++ 19 yet, and they<br>
&gt; are missing a few headers too. So it depends on whether you want to<br>
&gt; target -CURRENT only?<br>
&gt;<br>
&gt; -Dimitry<br>
<br>
I guess I should&#39;ve mentioned that I would like to MFC to stable/14,<br>
too.  I certainly intend to avoid exotic parts.  Is there any better<br>
way to ensure that may code will build other than &quot;make universe&quot;?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">No.</div><div dir="auto"><br></div><div dir="auto">But I keep a stable/13 and stable/14 trees around that I build on amd64 and armv7 for all changes unless I&#39;m worried. It&#39;s faster. Another way is to have jails for these environments for incremental development or quick experiments. Poudriere is a good way to build those jails quickly.</div><div dir="auto"><br></div><div dir="auto">Warner </div></div>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqc3b=1AeoAcDGcOkD64o6LKrk56FDUnqbSx6f5DFcdRg>