Mandates explicit -std=c++XY for c++ projects
- Date: Tue, 10 Oct 2017 08:45:49 +0200
- From: Mathieu Malaterre <malat@xxxxxxxxxx>
- Subject: Mandates explicit -std=c++XY for c++ projects
Since the GCC 6 release , the default mode for C++ is now
-std=gnu++14 instead of -std=gnu++98. What this means is that upon
(re)compilation a library written for c++98 will be recompiled using a
different c++ standard (c++14 in this case), unless of course the
upstream package explicitly set the -std= flags with the appropriate
The ISO committee generally describe the change in between different
standards  and in some case, one can find examples of subtle change
in behaviors  and .
With this mind I'd like to make mandatory the -std=c++XY flags when
compiling either a c++ library or a stand-alone c++ program:
1. Either upstream define the explicit -std=c++XY flags by mean of its
2. Or the package maintainers needs to explicit change the CXXFLAGS to
pass the appropriate version of the c++ standard. In which case this
should be documented in the README.Debian file.
3. As a fallback, dh should initialize the CXXFLAGS with -std=gnu++98
If there is a consensus on the following change, I'll go ahead and
also file a bug for lintian to scan the compilation logs in search for
missing -std=c++ expression when g++ command line are issued.
Thanks for your comments,