[Interest] How do you want to select exactly C++11 with GCC 6+?

Thiago Macieira thiago.macieira at intel.com
Fri Mar 10 19:00:36 CET 2017


On sexta-feira, 10 de março de 2017 08:26:21 PST Nikos Chantziaras wrote:
> On 03/09/2017 03:13 PM, Thiago Macieira wrote:
> > 1) is there a need for qmake to provide a way to select *exactly* C++11,
> > not a later, available version?
> 
> Maybe packagers (Linux distros) would need one due to ABI issues? 

That's their problem. Linux packagers don't modify .pro files and should not be 
changing the C++ edition settings like that. If they need something specific, 
they should enforce it directly in the mkspec, not in each package.

> But those people would probably modify CXXFLAGS directly.

Right.

> > 2) if the answer is "yes", how would you prefer to do so?
> > 
> > 	option I:		CONFIG += c++11
> > 	option II:	CONFIG -= c++14		(obviously disables later editions too)
> 
> To me it looks like qmake should always specify the "-std" option (or
> equivalent) and simply have its own default regardless of the compiler
> that is being used. If nothing is added to CONFIG, have the default be
> the lowest common denominator (which AFAIK is C++11). So if you don't do
> anything, or do "CONFIG += c++11", you only get C++11 and nothing else.
> 
> So that would be something qmake "just does" to achieve consistency
> between compilers.

True, that's third option.

Except that we can't do that with MSVC, since you can't toggle the features on 
or off. And it's different behaviour compared to past versions of Qt: if you 
use Qt 5.5 and GCC 6, you'll get C++14 by default. In any case, one of the two 
options above is also a behaviour change.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list