]> granicus.if.org Git - libevent/commitdiff
cmake: sync warnings with autotools v2
authorAzat Khuzhin <azat@libevent.org>
Tue, 12 Mar 2019 21:02:39 +0000 (00:02 +0300)
committerAzat Khuzhin <azat@libevent.org>
Tue, 12 Mar 2019 21:21:38 +0000 (00:21 +0300)
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

index c761b04f3bb824753365a51be8545975faf93765..b7229f29a7315f70d968d6c2737eaa716e09af25 100644 (file)
@@ -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()