Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix -Wunused-private-field warnings #158

Closed
wants to merge 1 commit into from

3 participants

@nanoant

Resolved following issues when using Clang with -Wall:

  • catch_console_colour private field m_impl only used on Windows when no ANSI

  • catch_reporter_junit private field m_currentTestSuccess is not used at all

In file included from t.cpp:3:
In file included from ../lib/catch/include/catch.hpp:39:
In file included from ../lib/catch/include/internal/catch_impl.hpp:23:
In file included from ../lib/catch/include/internal/catch_console_colour_impl.hpp:11:
../lib/catch/include/internal/catch_console_colour.hpp:39:28: warning: private field 'm_impl' is not
      used [-Wunused-private-field]
        ConsoleColourImpl* m_impl;
                           ^
In file included from t.cpp:3:
In file included from ../lib/catch/include/catch.hpp:39:
In file included from ../lib/catch/include/internal/catch_impl.hpp:35:
../lib/catch/include/internal/../reporters/catch_reporter_junit.hpp:237:14: warning: private field
      'm_currentTestSuccess' is not used [-Wunused-private-field]
        bool m_currentTestSuccess;
@nanoant nanoant Fix -Wunused-private-field warnings
* catch_console_colour private field 'm_impl' only used on Windows when no ANSI

* catch_reporter_junit private field 'm_currentTestSuccess' is not used at all
8b1f62b
@philsquared
Owner

Sorry - I meant to get back to you ages ago about this.
Was this on the integration or master branch?
I believe both neither of these issues are there in integration any more - but I believe they are on Master

@wojdyr

I see these warnings when using single-file catch.hpp from the deprecated downloads tab.

@philsquared
Owner

Ah. I forgot that was still being linked to from the README. I've updated the link now.
That will give you a more recent version - but I'm not sure if that will fix the warnings. IIRC they will still be there for now on Master but not, as I say, on Integration (see. builds.catch-lib.net for the integration download)

@wojdyr

Nice logo. You could link this website from the github site. There is a place for website link above the git url, see e.g. https://github.com/rails/rails

@philsquared
Owner

Thanks (the logo wasn't designed by me - I outsourced that ;-) ).

I intend to build that page (builds.catch-lib.net) out into a full landing page for Catch - or I may just roll it back in to the README (see the README on the integration branch, for example), but my time is too divided elsewhere at the moment. It might still be worth the top-link back, though - thanks for the suggestion.

@nanoant

I am closing this as it seems to be fixed in Integration branch.

@nanoant nanoant closed this
@nanoant nanoant deleted the nanoant:fix-Wunused-private-field branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2013
  1. @nanoant

    Fix -Wunused-private-field warnings

    nanoant authored
    * catch_console_colour private field 'm_impl' only used on Windows when no ANSI
    
    * catch_reporter_junit private field 'm_currentTestSuccess' is not used at all
This page is out of date. Refresh to see the latest.
View
2  include/internal/catch_console_colour.hpp
@@ -35,8 +35,10 @@ namespace Catch {
void set( Colours colour );
~TextColour();
+#if !defined( CATCH_CONFIG_USE_ANSI_COLOUR_CODES ) && defined ( CATCH_PLATFORM_WINDOWS )
private:
ConsoleColourImpl* m_impl;
+#endif
};
} // end namespace Catch
View
1  include/reporters/catch_reporter_junit.hpp
@@ -234,7 +234,6 @@ namespace Catch {
private:
ReporterConfig m_config;
- bool m_currentTestSuccess;
Stats m_testSuiteStats;
Stats* m_currentStats;
Something went wrong with that request. Please try again.