From bad6c550f8f45da60bfd4e2592fee35abc1e1cd7 Mon Sep 17 00:00:00 2001
From: Steven Hahn <hahnse@ornl.gov>
Date: Mon, 3 Jul 2017 14:04:39 -0400
Subject: [PATCH] Avoid -Wpedantic with clang.

---
 buildconfig/CMake/GNUSetup.cmake | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/buildconfig/CMake/GNUSetup.cmake b/buildconfig/CMake/GNUSetup.cmake
index ed9e6e3be7e..8e20b760df5 100644
--- a/buildconfig/CMake/GNUSetup.cmake
+++ b/buildconfig/CMake/GNUSetup.cmake
@@ -37,18 +37,16 @@ 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 -Wno-unused-result -Wpedantic")
-
-if ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
-  set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion")
-endif()
+set( GNUFLAGS "${GNUFLAGS} -Wno-deprecated -Wno-write-strings -Wno-unused-result")
 
 # Check if we have a new enough version for these flags
 if ( CMAKE_COMPILER_IS_GNUCXX )
+  set (GNUFLAGS "${GNUFLAGS} -Wpedantic")
   if (NOT (GCC_COMPILER_VERSION VERSION_LESS "5.1"))
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
-    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -Wsuggest-final-types -Wsuggest-final-methods")
+    set(GNUFLAGS "${GNUFLAGS} -Wsuggest-override")
   endif()
+else if ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+  set(GNUFLAGS "${GNUFLAGS} -Wno-sign-conversion")
 endif()
 
 # Add some options for debug build to help the Zoom profiler
-- 
GitLab