[cmake-developers] [PATCH] Features: Only enable C11 support on GCC >= 4.9.

Brad King brad.king at kitware.com
Mon Sep 14 14:02:43 EDT 2015


On 09/14/2015 01:53 PM, Raphael Kubo da Costa wrote:
> Especially if you take into account the
> CMAKE_CXX11_STANDARD_COMPILE_OPTION argument, one could argue that this
> is about choosing how strict CMake should be when determining whether a
> compiler implements a standard: enabling C++11 support only with GCC 4.8
> looks limiting and leaves out all the cases where it actually works fine
> with earlier versions. Is this patch too broad for C11 and GCC, or is it
> different from the C++11 case?

The idea of these option tables is for CMake to be able to tell the
compiler to *nominally* enable support for a given language standard.
The extent to which the compiler actually supports it is up to the
project to deal with.  If we waited for 100% support of a language
then many compilers will never get there.

In this case CMake itself cannot build with C11 on this compiler/platform
combination so we should not try to do so.  We already have some checks
here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=CMakeLists.txt;hb=v3.3.1#l39

to decide whether to try using the latest standard or not.  One could
add a check for the case in question if necessary.

> It sounded like Brad was in favor of the former, whereas you'd like the
> change not to be merged.

Actually I didn't investigate deeply enough before commenting.  The
mailing list is a much better place for such discussion anyway.

-Brad



More information about the cmake-developers mailing list