From 42d5a36bd8076c137545759d34500401627a649b Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 13 Mar 2019 00:02:39 +0300 Subject: [PATCH] cmake: sync warnings with autotools v2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit By some reason gcc reports next error: ../http.c:3330:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] value = ""; Only under -Wwrite-strings, well this is logical, but this information does not reflected in any documentation. Follow-up: 8348b413 ("cmake: add various warning flags like autotools has") f --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c761b04f..b7229f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,7 +259,7 @@ if (${GNUC}) set(GCC_V ${CMAKE_C_COMPILER_VERSION}) list(APPEND __FLAGS - -Wall -Wextra -Wno-unused-parameter -Wstrict-aliasing + -Wall -Wextra -Wno-unused-parameter -Wstrict-aliasing -Wstrict-prototypes -fno-strict-aliasing # gcc 2.9.5+ @@ -270,14 +270,19 @@ if (${GNUC}) # gcc 4.2 -Waddress - -Wno-unused-function -Wnormalized=id -Woverride-init # gcc 4.5 -Wlogical-op + + -Wwrite-strings ) + if (${CLANG}) + list(APPEND __FLAGS -Wno-unused-function) + endif() + if (EVENT__DISABLE_GCC_WARNINGS) list(APPEND __FLAGS -w) endif() -- 2.40.0