From 140d2c16cd60102dc036ad6f2e1bb935d182d48d Mon Sep 17 00:00:00 2001
From: Steven Hahn <hahnse@ornl.gov>
Date: Mon, 3 Jul 2017 11:54:28 -0400
Subject: [PATCH] Some ParaView macros don't play nicely with -Wpedantic.

---
 Vates/ParaviewPlugins/CMakeLists.txt |  3 +++
 buildconfig/CMake/GNUSetup.cmake     | 12 +++---------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Vates/ParaviewPlugins/CMakeLists.txt b/Vates/ParaviewPlugins/CMakeLists.txt
index 51d5be27eb7..7ddcbe9c57b 100644
--- a/Vates/ParaviewPlugins/CMakeLists.txt
+++ b/Vates/ParaviewPlugins/CMakeLists.txt
@@ -1,6 +1,9 @@
 # bring in Mantid/VATES API dependencies
 set_mantid_subprojects( Vates/VatesAPI )
 
+# vtktypemacro doesn't play nicely with -Wpedantic
+string(REPLACE "-Wpedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
 # NonOrthogonalSourcePlugin is necessary for viewing materials with nonorthogonal basis vectors.
 # Copy it over to the pvplugins dir
 if("${CMAKE_CFG_INTDIR}" STREQUAL ".")
diff --git a/buildconfig/CMake/GNUSetup.cmake b/buildconfig/CMake/GNUSetup.cmake
index b25b8c6c6f4..ed9e6e3be7e 100644
--- a/buildconfig/CMake/GNUSetup.cmake
+++ b/buildconfig/CMake/GNUSetup.cmake
@@ -37,16 +37,10 @@ set( GNUFLAGS "-Wall -Wextra -Wconversion -Winit-self -Wpointer-arith -Wcast-qua
 # -Wno-deprecated: Do not warn about use of deprecated headers.
 # -Wno-write-strings: Do not warn about deprecated conversions of char*->const char*
 # -Wno-unused-result: Do not warn about unused return values in some C functions
-set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings")
+set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings -Wno-unused-result -Wpedantic")
 
-# Check if we have a new enough version for this flag
-# some -pedantic warnings remain with gcc 4.4.7
-if ( CMAKE_COMPILER_IS_GNUCXX )
-  if (NOT (GCC_COMPILER_VERSION VERSION_LESS "4.5"))
-    set(GNUFLAGS "${GNUFLAGS} -Wno-unused-result -pedantic")
-  endif ()
-elseif ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
-    set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion")
+if ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+  set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion")
 endif()
 
 # Check if we have a new enough version for these flags
-- 
GitLab