From cc223e1eed69775a323a59628ad93fc79390c2f2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 2 Aug 2016 11:31:50 -0400 Subject: [PATCH 1/3] Intel-C: declare support for gnu11 Without extensions, functions like `strdup` are not available since they are actually controlled by feature flags such as _SVID_SOURCE and _BSD_SOURCE. When using `-std=c11` on Intel, none of these flags are set, so the functions are not declared properly leading to compile errors. Reported-by: Adam J. Stewart Closes: #16226 --- Modules/Compiler/Intel-C.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index eb9602a16..b2ff50d94 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -16,7 +16,7 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "${_std}=c11") - set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=c11") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=gnu11") endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) From 27a3ca15e5e92abbdf9228a5ac83c190a5caf0a8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 2 Aug 2016 13:10:30 -0400 Subject: [PATCH 2/3] Intel-C: support gnu89 and gnu99 extension flags --- Modules/Compiler/Intel-C.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index b2ff50d94..0efcbc20d 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -21,9 +21,9 @@ endif() if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "${_std}=c89") - set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=c89") + set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=gnu89") set(CMAKE_C99_STANDARD_COMPILE_OPTION "${_std}=c99") - set(CMAKE_C99_EXTENSION_COMPILE_OPTION "${_std}=c99") + set(CMAKE_C99_EXTENSION_COMPILE_OPTION "${_std}=gnu99") endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) From 088f14eb725650158d256c28e86e44da3989ad9c Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 2 Aug 2016 13:10:56 -0400 Subject: [PATCH 3/3] Intel-C: standard flags are also supported in 12.0 --- Modules/Compiler/Intel-C.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index 0efcbc20d..edca154de 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -19,7 +19,7 @@ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_EXTENSION_COMPILE_OPTION "${_std}=gnu11") endif() -if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1) +if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 12.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "${_std}=c89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "${_std}=gnu89") set(CMAKE_C99_STANDARD_COMPILE_OPTION "${_std}=c99")