Compiler warnings (known bug)

  • Raoul Gough

    Raoul Gough - 2004-11-29

    I'm getting compilation warnings using the Sun C++ compiler in TextTestRunner.h which match those reported in 884939 for the Borland compiler. The Sun warning looks like this:

    "/cppunit/include/cppunit/ui/text/TextTestRunner.h", line 88: Warning: CppUnit::TextTestRunner::run hides the virtual function CppUnit::TestRunner::run(CppUnit::TestResult&, const std::string &).

    It looks to me like there are two possible fixes:

    1. Add a using declaration in TextTestRunner to fix the warning. This assumes the intention was really not to override the base class function.

    2. Change the base class (and other derived classes) to have the same signature. This assumes the intention really was to override the base class function.

    Is anybody planning to fix this? I'm trying to advocate a "no warnings" policy, but it's a bit hard if third party code causes them.

    • Baptiste Lepilleur

      (2) is the solution. The issue is that the 'using' keyword is not that portable (in regards to compiler targeted by CppUnit 1.x). So unless someone step in and add autodetection is automake, this aren't going to happen.

      Anyway, I would recommend that you use some compiler output filter (just like it is usually done for memory leak detector) and automatically hide those 'useless' warning.

      Anyway, this class is only there for compatibilty with older version. The generic TestRunner is much more flexible.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks