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 <<a href="mailto:asomers@freebsd.org" target="_blank" rel="noreferrer">asomers@freebsd.org</a>> 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 <<a href="mailto:dim@freebsd.org" rel="noreferrer noreferrer" target="_blank">dim@freebsd.org</a>> wrote:<br> ><br> > On 8 Jan 2025, at 18:31, Alan Somers <<a href="mailto:asomers@freebsd.org" rel="noreferrer noreferrer" target="_blank">asomers@freebsd.org</a>> wrote:<br> > ><br> > > What is the newest C++ standard that we can target in src, and be<br> > > confident that it will compile on all targets? Can we use C++20?<br> ><br> > C++17 is probably the safest one, as C++20 support in libc++ 19 is<br> > mostly done, but not entirely complete:<br> ><br> > <a href="https://libcxx.llvm.org/Status/Cxx20.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://libcxx.llvm.org/Status/Cxx20.html</a><br> ><br> > As long as you avoid modules, and the more exotic parts, you should be<br> > fine. One glaring remaining issue is that std::jthread support is still<br> > gated under -fexperimental-library, at least until libc++ 20 comes out.<br> ><br> > That said, older existing releases don't have libc++ 19 yet, and they<br> > are missing a few headers too. So it depends on whether you want to<br> > target -CURRENT only?<br> ><br> > -Dimitry<br> <br> I guess I should'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 "make universe"?<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'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.</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>
