Re: minimum required -std=c++NN?

"David H. Gutteridge" <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
On Fri, 21 Jun 2024 at 20:29:04 +0200, Christoph Badura wrote:
> While dealing with cross-builing -current w/gcc-12 on macOS I've 
> noticed
> that we have different settings for HOST_CXXFLAGS/CXX_FLAGS in various
> parts of the source tree:
> 
> src/external/mit/xorg/lib/gallium.old/Makefile:CXXFLAGS+=	-std=c++14
> src/external/mit/xorg/lib/gallium/Makefile:CXXFLAGS+=	-std=c++14
> src/external/apache2/llvm/Makefile.inc:HOST_CXXFLAGS+=	-std=c++14
> src/external/apache2/llvm/Makefile.inc:CXXFLAGS+=	-std=c++14
> src/external/gpl3/gcc/usr.bin/host-libcpp/Makefile:HOST_CXXFLAGS+=	-std=c++11
> src/tests/lib/libc/sync/Makefile:CXXFLAGS+= -std=c++11
> src/tests/libexec/ld.elf_so/helper_dso3/Makefile:CXXFLAGS+=	-std=c++11
> src/tools/gcc/Makefile:HOST_CXXFLAGS+=		-std=c++11
> 
> I guess gallium, libc/sync and ld.elf_so aren't build as a tool.  But
> the compilers are
> 
> Would it be desirable to set these to consistent values (i.e.
> -stdt=c++14)?  If so, should we centralize that in a variable in
> bsd.own.mk?

I would think no, because it's possible to have different components
within the tree that conflict in some way. The paths some software
projects are taking now, there can even be different versions of the
same language required in varied parts of their specific tree. (E.g.,
LibreOffice applies multiple C++ standards contextually. Obviously we
won't be importing that example, but expecting and applying a
consistent language version sets up false expectations, IMO.)

Regards,

Dave
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.