tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: c++11



On 11/03/16 14:46, Greg Troxel wrote:
Thomas Klausner <tk%giga.or.at@localhost> writes:

Shouldn't we rather add support to USE_LANGUAGES like this:

USE_LANGUAGES+=	c++11

and make bsd.pkg.mk set CXXFLAGS and request a good-enough compiler?
I have the impression that in a C++ program one can't mix compilers and
expect it to work.  If e.g. one compiles a library with gcc 4.5, and a
program with 4.8, and then links them with 4.8, will that
program/library work correctly?  This seems to reliably work in C.  If
it's not reliable/true in C++, is it because each compiler has a
different ABI?  Some other reason?

Is it then necessary to arrange for all programs to be built with the
same compiler?

And, is this need-same-compiler issue related to issues from switching
between clang and gcc (which seems inadvisable on the fly)?



I haven't had any trouble mixing various GCC versions, as long as they are the same major version. That goes for C, C++, and Fortran.

I recall some trouble in the past mixing GCC 3.x and 4.x.

No issues so far mixing clang 3.x and GCC 4.x on FreeBSD or CentOS + pkgsrc.

--
Earth is a beta site.



Home | Main Index | Thread Index | Old Index