Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Fixed some warnings

As referenced in GitHub issue #83
Commit
8d69208a58e40a78cc56662cd460ef5b30ae0912
Author
Phil Nash ·
Parents
15140eacd761

Files · Download .tar.gz

Changes

 include/internal/catch_common.h                                     | 6 +++---
 include/internal/catch_tostring.hpp                                 | 2 +-
 include/reporters/catch_reporter_basic.hpp                          | 4 ++--
 .../XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj    | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h
index 3b69959f..a5aed1b9 100644
--- a/include/internal/catch_common.h
+++ b/include/internal/catch_common.h
@@ -67,9 +67,9 @@ namespace Catch
     struct SourceLineInfo
     {
         SourceLineInfo() : line( 0 ){}
-        SourceLineInfo( const std::string& file, std::size_t line )
-        :   file( file ),
-            line( line )
+        SourceLineInfo( const std::string& _file, std::size_t _line )
+        :   file( _file ),
+            line( _line )
         {}
         SourceLineInfo( const SourceLineInfo& other )
         :   file( other.file ),
diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp
index bad0196c..98ed8191 100644
--- a/include/internal/catch_tostring.hpp
+++ b/include/internal/catch_tostring.hpp
@@ -103,7 +103,7 @@ inline std::string toString( unsigned long value ) {
 }
     
 inline std::string toString( unsigned int value ) {
-    return toString( (unsigned long)value );
+    return toString( static_cast<unsigned long>( value ) );
 }
     
 inline std::string toString( const double value ) {
diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp
index 7db72734..be631f13 100644
--- a/include/reporters/catch_reporter_basic.hpp
+++ b/include/reporters/catch_reporter_basic.hpp
@@ -247,12 +247,12 @@ namespace Catch
                 m_config.stream() << resultInfo.getExpression();
                 if( resultInfo.ok() )
                 {
-                    TextColour colour( TextColour::Success );
+                    TextColour successColour( TextColour::Success );
                     m_config.stream() << " succeeded";
                 }
                 else
                 {
-                    TextColour colour( TextColour::Error );
+                    TextColour errorColour( TextColour::Error );
                     m_config.stream() << " failed";
                 }
             }
diff --git a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
index db8a0a84..b614ae38 100644
--- a/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
+++ b/projects/XCode4/CatchSelfTest/CatchSelfTest.xcodeproj/project.pbxproj
@@ -376,6 +376,7 @@
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_SHADOW = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
@@ -400,6 +401,7 @@
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_SHADOW = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				SDKROOT = macosx;