Skip to content

Compilation results in tons of warnings #64

Description

@JeffAbrahamson

╭╴ (master=)╶╮
╰ jeff@siegfried:json $ uname -a
Linux siegfried 3.16.0-33-generic #44-Ubuntu SMP Thu Mar 12 12:19:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
╭╴ (master=)╶╮
╰ jeff@siegfried:json $ make
g++ -std=c++11 -Wall -Wextra -pedantic -Weffc++ -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wfloat-equal -I src -I test test/unit.cpp -o json_unit
In file included from test/unit.cpp:11:0:
test/catch.hpp:264:57: warning: ‘const T& Catch::operator+(const T&, Catch::StreamEndStop)’ should return by value [-Weffc++]
T const& operator + ( T const& value, StreamEndStop ) {
^
test/catch.hpp: In copy constructor ‘Catch::NotImplementedException::NotImplementedException(const Catch::NotImplementedException&)’:
test/catch.hpp:280:9: warning: ‘Catch::NotImplementedException::m_what’ should be initialized in the member initialization list [-Weffc++]
NotImplementedException( NotImplementedException const& ) {}
^
test/catch.hpp:280:9: warning: ‘Catch::NotImplementedException::m_lineInfo’ should be initialized in the member initialization list [-Weffc++]
In file included from test/unit.cpp:11:0:
test/catch.hpp: At global scope:
test/catch.hpp:478:7: warning: ‘class Catch::MethodTestCase’ only defines a private destructor and has no friends [-Wctor-dtor-privacy]
class MethodTestCase : public SharedImpl {
^
test/catch.hpp: In constructor ‘Catch::AssertionInfo::AssertionInfo()’:
test/catch.hpp:645:9: warning: ‘Catch::AssertionInfo::macroName’ should be initialized in the member initialization list [-Weffc++]
AssertionInfo() {}
^
test/catch.hpp:645:9: warning: ‘Catch::AssertionInfo::lineInfo’ should be initialized in the member initialization list [-Weffc++]
test/catch.hpp:645:9: warning: ‘Catch::AssertionInfo::capturedExpression’ should be initialized in the member initialization list [-Weffc++]
test/catch.hpp:645:9: warning: ‘Catch::AssertionInfo::resultDisposition’ should be initialized in the member initialization list [-Weffc++]
test/catch.hpp: In constructor ‘Catch::AssertionResultData::AssertionResultData()’:
test/catch.hpp:659:9: warning: ‘Catch::AssertionResultData::reconstructedExpression’ should be initialized in the member initialization list [-Weffc++]
AssertionResultData() : resultType( ResultWas::Unknown ) {}
^
test/catch.hpp:659:9: warning: ‘Catch::AssertionResultData::message’ should be initialized in the member initialization list [-Weffc++]

...

Activity

  1. self-assigned this
    on May 1, 2015
  2. nlohmann commented on May 1, 2015

    @nlohmann
    Owner

    Hi @JeffAbrahamson, thanks for reporting!

    I switched on the warnings to see whether there are warnings in the json.hpp header. The warnings you see all affect the Catch unit test framework, and I think this ticket addresses this issue.

    All the best
    Niels

  3. added
    solution: wontfixthe issue will not be fixed (either it is impossible or deemed out of scope)
    on May 1, 2015
  4. added a commit that references this issue on Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

solution: wontfixthe issue will not be fixed (either it is impossible or deemed out of scope)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions