From 87cb3250cdc8f57732e245ad2adf54bf53f638ca Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 16 Oct 2022 08:12:26 +0100 Subject: [PATCH] Set C99 as the explicit, not implicit, build standard. --- CMakeLists.txt | 3 +++ ChangeLog.txt | 1 + config.mk | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 07b24642..6f78402a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ project(mosquitto LANGUAGES C CXX ) +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") add_definitions (-DCMAKE -DVERSION=\"${VERSION}\") diff --git a/ChangeLog.txt b/ChangeLog.txt index 0bf0c0f4..2aaee403 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -160,6 +160,7 @@ Build: - Increased CMake minimal required version to 3.14, which is required for the preinstalled SQLite3 find module. - Add an CMake option `WITH_LTO` to enable/disable link time optimization. +- Set C99 as the explicit, rather than implicit, build standard. 2.0.15 - 2022-08-16 diff --git a/config.mk b/config.mk index 7aac8cb8..c9f30d7e 100644 --- a/config.mk +++ b/config.mk @@ -164,7 +164,7 @@ ifeq ($(UNAME),SunOS) CFLAGS?=-Wall -ggdb -O2 endif else - CFLAGS?=-Wall -ggdb -O3 -Wconversion -Wextra + CFLAGS?=-Wall -ggdb -O3 -Wconversion -Wextra -std=gnu99 endif STATIC_LIB_DEPS:=