bison: fix warnings
authorMichael Wallner <mike@php.net>
Thu, 27 Feb 2020 09:52:12 +0000 (10:52 +0100)
committerMichael Wallner <mike@php.net>
Thu, 27 Feb 2020 09:52:12 +0000 (10:52 +0100)
src/libmemcached/CMakeLists.txt
src/libmemcached/csl/common.h

index e3bcfbe76d8048751a104850e42ced963d2f6d6e..4e8e0401d0565e40acf82edcaf10ec581f968178 100644 (file)
@@ -1,10 +1,15 @@
 
 find_package(FLEX)
-find_package(BISON)
+find_package(BISON 2.3)
+
+if(${BISON_VERSION} VERSION_GREATER_EQUAL 3.0)
+        set(BISON_WARNINGS -Wno-deprecated)
+endif()
 
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csl)
 bison_target(CSL_PARSER csl/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.cc
         DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.h
+        COMPILE_FLAGS ${BISON_WARNINGS}
         )
 flex_target(CSL_SCANNER csl/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.cc
         DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.h
index 46a950a3a64e9f23c005deb72264b518f59561ed..85881c1800051d08370eaa56708f3fb42379edd1 100644 (file)
@@ -48,7 +48,7 @@ typedef void* yyscan_t;
 #endif
 
 #ifndef YYSTYPE
-# define YYSTYPE union CONFIG_STYPE
+# define YYSTYPE CONFIG_STYPE
 #endif
 
 #define config_tokentype int