[Libreoffice] cppcheck headers problem? (was 'Question about cppcheck "unused private"')

someone at boldandbusted.com someone at boldandbusted.com
Wed Feb 16 20:09:29 PST 2011


On 02/16/11 12:43, Caolán McNamara wrote:
> 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.
> 
> 
> 
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice

Hi Caolán,

So cppcheck can't find the headers it needs? Is this a bug in cppcheck,
or LO's construction of header file paths? And how many examples of
cppcheck false positives due to this problem are present? Does a clear
example of where cppcheck *should* find the headers but *doesn't* exist?

Is there a way to prevent this particular problem for cppcheck?

Cheers,

Jesse Adelman
Linux Systems Consultant
http://ilikelinux.com/
http://www.boldandbusted.com/
Brisbane, CA USA


More information about the LibreOffice mailing list