Skip to content

Commit ccff08f

Browse files
committed
cmake: build against the C11 standard
The CMake build defaulted to C99 (matching the autotools AC_PROG_CC_C99). Raise it to C11, kept as gnu11 (CMAKE_C_EXTENSIONS ON) since the sources use GNU extensions (_GNU_SOURCE, asprintf). A commented C17 line is left for when the minimum supported toolchain is GCC 8+/Clang 7+.
1 parent bcd74c6 commit ccff08f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ set(LTFS_PACKAGE_NAME "LTFS")
2525
set(LTFS_PACKAGE_TARNAME "ltfs")
2626
set(LTFS_BUGREPORT "IBM corporation.")
2727

28-
set(CMAKE_C_STANDARD 99)
28+
set(CMAKE_C_STANDARD 11)
29+
#set(CMAKE_C_STANDARD 17) # bump to C17 once the oldest supported toolchains are GCC 8+/Clang 7+
2930
set(CMAKE_C_STANDARD_REQUIRED ON)
31+
set(CMAKE_C_EXTENSIONS ON) # gnu11: LTFS uses GNU extensions (_GNU_SOURCE, asprintf, ...)
3032
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
3133
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
3234
endif()

0 commit comments

Comments
 (0)