Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Sat, 2011-02-12 at 13:26 +0100, Julien Nabet wrote:
Hello

With the last git version of cppcheck, I've got in the master branch 
writer/sw/source/ui/dbui this :
[./dbmgr.cxx:222]: (style) Unused private function 
'SwConnectionDisposedListener_Impl::disposing'

I don't understand these errors and so how to correct them.
If it's a false positive cppcheck, I don't understand why.

So, this is basically one of a bunch of problems that cppcheck shows
because it's not able to find all the headers and so it can't tell that
the thing that dbmgr.cxx inherits from defines a public virtual void
disposing(); so it hopes for the best and notices that the disposing
here is in a "private" section and lets us know that from all cppcheck
can tell this is a private method that isn't called. Reduced test-case
attached if you want to report it.

But this is poor stylistically anyway so probably best to just fix it in
dbmgr.cxx by adding a public: before disposing and/or moving disposing
after private:

C.
#include <some_unfound_header_that_has_the_foo_template>

class bar : public foo< int >
{
    virtual void apple();
};

void bar::apple()
{
    std::cout << "hello world" << std::endl;
}

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.