changeset 12458:7f391a6a8961 draft

silence GCC 8 warnings -Wclass-memaccess and -Wcast-function-type
author Ma0 <mateuszb@poczta.onet.pl>
date Sat, 15 Dec 2018 02:13:14 +0100
parents 57ad7c870b17
children 17120cfb5c99
files source/CMakeLists.txt source/encoder/api.cpp
diffstat 2 files changed, 6 insertions(+-), 1 deletions(-) [+]
line wrap: on
line diff
--- a/source/CMakeLists.txt	Thu Dec 27 14:00:17 2018 +0530
+++ b/source/CMakeLists.txt	Sat Dec 15 02:13:14 2018 +0100
@@ -200,6 +200,9 @@ endif()
 if(GCC)
     add_definitions(-Wall -Wextra -Wshadow)
     add_definitions(-D__STDC_LIMIT_MACROS=1)
+    if(NOT INTEL_CXX AND NOT CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
+        add_definitions(-Wno-class-memaccess)
+    endif()
     if(ENABLE_HDR10_PLUS)
         if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
             message(FATAL_ERROR "gcc version above 4.8 required to support hdr10plus")
--- a/source/encoder/api.cpp	Thu Dec 27 14:00:17 2018 +0530
+++ b/source/encoder/api.cpp	Sat Dec 15 02:13:14 2018 +0100
@@ -705,9 +705,11 @@ typedef const x265_api* (*api_query_func
 #include <dlfcn.h>
 #define ext ".so"
 #endif
+#if defined(__GNUC__) && __GNUC__ >= 8
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+#endif
 
 static int g_recursion /* = 0 */;
-
 const x265_api* x265_api_get(int bitDepth)
 {
     if (bitDepth && bitDepth != X265_DEPTH)