Skip to content

Standard options first for C++ dialects

Pierre Jolivet requested to merge jolivet/fix-dialect-precedence into maint

I can't think of a good reason to try non-standard options first when checking out C++ dialects. Furthermore, non-standard options define additional preprocessor variables which may clash with user-defined ones. E.g., arch-linux-c-opt, will be replaced by arch-1-c-opt if ${PETSC_ARCH} is printf'd in C++ sources.

$ g++ -std=gnu++14 -dM -E -x c++ - < /dev/null|grep linux
#define __linux 1
#define __linux__ 1
#define __gnu_linux__ 1
#define linux 1
$ g++ -std=c++14 -dM -E -x c++ - < /dev/null|grep linux
#define __linux 1
#define __linux__ 1
#define __gnu_linux__ 1

Any objection, @jedbrown @sbalay? (cc @joseroman)

Merge request reports