Dear CMake developers,
find attached two small patches that get rid of C++ warnings I get from
the current GCC 5 development build.
One patch removes semicolons after methods, the other uses unsigned ints
for version numbers to match the type of the sscanf string %u.

Bye
Christoph
>From bcc6d27bdf781a51f3e60b35f0918ce4d503efab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruen...@dune-project.org>
Date: Tue, 23 Dec 2014 12:24:58 +0100
Subject: [PATCH 2/3] Remove superfluous semicolons after methods.

---
 Source/CTest/cmParseDelphiCoverage.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 8e331b1..3afbfac 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -240,7 +240,7 @@ bool cmParseDelphiCoverage::LoadCoverageData(
       }
     }
   return true;
-  };
+  }
 
 bool cmParseDelphiCoverage::ReadDelphiHTML(const char* file)
   {
@@ -248,4 +248,4 @@ bool cmParseDelphiCoverage::ReadDelphiHTML(const char* file)
      parser(this->CTest, this->Coverage);
   parser.ParseFile(file);
   return true;
-  };
+  }
-- 
2.1.2

>From e810b5f8e4a1288897c71f40a6ded20d4777fa97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= <gruen...@dune-project.org>
Date: Tue, 23 Dec 2014 13:33:35 +0100
Subject: [PATCH 3/3] use unsigned int for version numbers.

---
 Source/cmCMakeMinimumRequired.cxx | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx
index 58b61de..384e0a7 100644
--- a/Source/cmCMakeMinimumRequired.cxx
+++ b/Source/cmCMakeMinimumRequired.cxx
@@ -63,17 +63,17 @@ bool cmCMakeMinimumRequired
 
 
   // Get the current version number.
-  int current_major = cmVersion::GetMajorVersion();
-  int current_minor = cmVersion::GetMinorVersion();
-  int current_patch = cmVersion::GetPatchVersion();
-  int current_tweak = cmVersion::GetTweakVersion();
+  unsigned int current_major = cmVersion::GetMajorVersion();
+  unsigned int current_minor = cmVersion::GetMinorVersion();
+  unsigned int current_patch = cmVersion::GetPatchVersion();
+  unsigned int current_tweak = cmVersion::GetTweakVersion();
 
   // Parse at least two components of the version number.
   // Use zero for those not specified.
-  int required_major = 0;
-  int required_minor = 0;
-  int required_patch = 0;
-  int required_tweak = 0;
+  unsigned int required_major = 0;
+  unsigned int required_minor = 0;
+  unsigned int required_patch = 0;
+  unsigned int required_tweak = 0;
   if(sscanf(version_string.c_str(), "%u.%u.%u.%u",
             &required_major, &required_minor,
             &required_patch, &required_tweak) < 2)
-- 
2.1.2

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to