From b940380cf91ef324b0ac8067362a7ce853ebf055 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <github@naumov.de>
Date: Sat, 23 Feb 2019 17:55:12 +0100
Subject: [PATCH] [App/IO] Check gmsh return value.

---
 Applications/FileIO/Legacy/createSurface.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Applications/FileIO/Legacy/createSurface.cpp b/Applications/FileIO/Legacy/createSurface.cpp
index cf893501b57..b7ad63fd19e 100644
--- a/Applications/FileIO/Legacy/createSurface.cpp
+++ b/Applications/FileIO/Legacy/createSurface.cpp
@@ -82,11 +82,12 @@ bool createSurface(GeoLib::Polyline const& ply,
     std::string gmsh_command =
         "gmsh -2 -algo meshadapt \"" + file_base_name + ".geo\"";
     gmsh_command += " -o \"" + file_base_name + ".msh\"";
-    // Temporarilly disable unused result warning
-    #pragma GCC diagnostic push
-    #pragma GCC diagnostic ignored "-Wunused-result"
-    std::system(gmsh_command.c_str());
-    #pragma GCC diagnostic pop
+    int const gmsh_return_value = std::system(gmsh_command.c_str());
+    if (gmsh_return_value != 0)
+    {
+        WARN("Call to '%s' returned non-zero value %d.", gmsh_command.c_str(),
+             gmsh_return_value);
+    }
     auto surface_mesh =
         FileIO::GMSH::readGMSHMesh("\"" + file_base_name + ".msh\"");
     if (!surface_mesh)
-- 
GitLab