]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Allow configure checks to be run with more warnings fix_warnings_in_configure_checks 7247/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 28 Sep 2018 02:50:15 +0000 (04:50 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 28 Sep 2018 02:50:15 +0000 (04:50 +0200)
cmake/checks/check_01_cxx_features.cmake

index a9a6ce7ea0af7c29454dcdddbf3619f556e6f761..80387a123af9ce6bc36670de84a3f872bb493da4 100644 (file)
@@ -269,6 +269,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX14 OR DEAL_II_WITH_CXX14)
       int main()
       {
           constexpr int max = std::max(0,1);
+          (void) max;
       }
       "
       DEAL_II_HAVE_CXX14_CONSTEXPR_STDMAXMIN)
@@ -292,6 +293,7 @@ IF(NOT DEFINED DEAL_II_WITH_CXX14 OR DEAL_II_WITH_CXX14)
       int main()
       {
         foo bar;
+        (void) bar;
       }
       "
       DEAL_II_HAVE_CXX14_CLANGAUTODEBUG_BUG_OK)
@@ -339,14 +341,8 @@ CHECK_CXX_SOURCE_COMPILES(
   #include <condition_variable>
   #include <type_traits>
 
-  // type traits functionality
-  constexpr auto m0 = std::is_trivial<double>::value;
-  constexpr auto m1 = std::is_standard_layout<double>::value;
-  constexpr auto m2 = std::is_pod<double>::value;
-
   // thread_local storage specification
-  thread_local std::array<int,3> p;
-  std::condition_variable c;
+  static thread_local std::array<int,3> p;
 
   // Check the version language macro, but skip MSVC because
   // MSVC reports 199711 even in MSVC 2017.
@@ -356,8 +352,17 @@ CHECK_CXX_SOURCE_COMPILES(
 
   int main()
   {
+    std::condition_variable c;
     p[0];
     c.notify_all();
+
+   // type traits functionality
+   constexpr auto m0 = std::is_trivial<double>::value;
+   (void) m0;
+   constexpr auto m1 = std::is_standard_layout<double>::value;
+   (void) m1;
+   constexpr auto m2 = std::is_pod<double>::value;
+   (void) m2;
   }
   "
   DEAL_II_HAVE_CXX11_FEATURES)
@@ -385,7 +390,8 @@ CHECK_CXX_SOURCE_COMPILES(
   #include <ctype.h>
   int main ()
   {
-    char c = toupper('a');
+    int c = toupper('a');
+    (void) c;
   }
   "
   DEAL_II_HAVE_CXX11_MACOSXC99BUG_OK)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.