From: Azat Khuzhin Date: Tue, 12 Mar 2019 21:02:39 +0000 (+0300) Subject: cmake: sync warnings with autotools v2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42d5a36bd8076c137545759d34500401627a649b;p=libevent cmake: sync warnings with autotools v2 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 --- 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()