From 7f7f9336c82e4b86474602417bbaa7498c346719 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 28 Feb 2018 14:31:48 +0100
Subject: [PATCH] COMP: add -fpermissive to c++LESSWARN flags (closes #744)

- downgrades some diagnostics about nonconformant code from errors to
  warnings. Oddly enough, the errors actually arise from STL library
  elements shipped with gcc itself. Affects kahip compilation with
  gcc-6, gcc-7
---
 wmake/rules/linux64Gcc/c++      | 6 ++++--
 wmake/rules/linux64GccKNL/c++   | 6 ++++--
 wmake/rules/linuxARM64Gcc/c++   | 6 ++++--
 wmake/rules/linuxARM7Gcc/c++    | 6 ++++--
 wmake/rules/linuxGcc/c++        | 6 ++++--
 wmake/rules/linuxIA64Gcc/c++    | 6 ++++--
 wmake/rules/linuxPPC64Gcc/c++   | 6 ++++--
 wmake/rules/linuxPPC64leGcc/c++ | 6 ++++--
 wmake/rules/solaris64Gcc/c++    | 2 +-
 wmake/rules/solarisGcc/c++      | 2 +-
 10 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++
index a94b22983ab..fc684d26376 100644
--- a/wmake/rules/linux64Gcc/c++
+++ b/wmake/rules/linux64Gcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11 -m64
 
diff --git a/wmake/rules/linux64GccKNL/c++ b/wmake/rules/linux64GccKNL/c++
index 199d72c0fdc..426e87709a2 100644
--- a/wmake/rules/linux64GccKNL/c++
+++ b/wmake/rules/linux64GccKNL/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11 -m64 -march=knl
 
diff --git a/wmake/rules/linuxARM64Gcc/c++ b/wmake/rules/linuxARM64Gcc/c++
index 3985f54a9be..c80f07611f1 100644
--- a/wmake/rules/linuxARM64Gcc/c++
+++ b/wmake/rules/linuxARM64Gcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11
 
diff --git a/wmake/rules/linuxARM7Gcc/c++ b/wmake/rules/linuxARM7Gcc/c++
index 3985f54a9be..c80f07611f1 100644
--- a/wmake/rules/linuxARM7Gcc/c++
+++ b/wmake/rules/linuxARM7Gcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11
 
diff --git a/wmake/rules/linuxGcc/c++ b/wmake/rules/linuxGcc/c++
index 3076e7e6c03..989fb670d4b 100644
--- a/wmake/rules/linuxGcc/c++
+++ b/wmake/rules/linuxGcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11 -m32
 
diff --git a/wmake/rules/linuxIA64Gcc/c++ b/wmake/rules/linuxIA64Gcc/c++
index de9a95ab4b1..30ef1360382 100644
--- a/wmake/rules/linuxIA64Gcc/c++
+++ b/wmake/rules/linuxIA64Gcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11
 
diff --git a/wmake/rules/linuxPPC64Gcc/c++ b/wmake/rules/linuxPPC64Gcc/c++
index 1bc42bc7cf7..1c03f810215 100644
--- a/wmake/rules/linuxPPC64Gcc/c++
+++ b/wmake/rules/linuxPPC64Gcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11 -m64 -mcpu=power5+
 
diff --git a/wmake/rules/linuxPPC64leGcc/c++ b/wmake/rules/linuxPPC64leGcc/c++
index 341a2b59550..c3d60d0fee8 100644
--- a/wmake/rules/linuxPPC64leGcc/c++
+++ b/wmake/rules/linuxPPC64leGcc/c++
@@ -3,8 +3,10 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+# Suppress some warnings (flex++, CGAL, etc)
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
 
 CC          = g++ -std=c++11 -m64 -mcpu=power8
 
diff --git a/wmake/rules/solaris64Gcc/c++ b/wmake/rules/solaris64Gcc/c++
index 74b72eecd8f..d5d600a7589 100644
--- a/wmake/rules/solaris64Gcc/c++
+++ b/wmake/rules/solaris64Gcc/c++
@@ -3,7 +3,7 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
+# Suppress some warnings (flex++, CGAL, etc)
 c++LESSWARN =
 
 CC          = g++ -std=c++11 -m64
diff --git a/wmake/rules/solarisGcc/c++ b/wmake/rules/solarisGcc/c++
index cf37d4c57b9..c68c26a29da 100644
--- a/wmake/rules/solarisGcc/c++
+++ b/wmake/rules/solarisGcc/c++
@@ -3,7 +3,7 @@ SUFFIXES += .C .cc .cpp .cxx
 c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
               -Wno-invalid-offsetof -Wno-attributes
 
-# Suppress some warnings for flex++ and CGAL
+# Suppress some warnings (flex++, CGAL, etc)
 c++LESSWARN =
 
 CC          = g++ -std=c++11
-- 
GitLab