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


On 16/08/2020 18:55, Julien Nabet wrote:
On pc Debian x86-64 with master sources updated today with non debug build, I got these building errors:

In file included from /home/julien/lo/libo_perf/slideshow/source/engine/box2dtools.cxx:10: /home/julien/lo/libo_perf/slideshow/source/inc/box2dtools.hxx:212:24: error: this member function can be declared static [loplugin:staticmethods]     Box2DBodySharedPtr makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody);
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/julien/lo/libo_perf/slideshow/source/engine/box2dtools.cxx:370:32: note: defined here: [loplugin:staticmethods] Box2DBodySharedPtr box2DWorld::makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/julien/lo/libo_perf/slideshow/source/engine/box2dtools.cxx:10: /home/julien/lo/libo_perf/slideshow/source/inc/box2dtools.hxx:230:24: error: this member function can be declared static [loplugin:staticmethods]     Box2DBodySharedPtr makeBodyStatic(const Box2DBodySharedPtr& pBox2DBody);
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/julien/lo/libo_perf/slideshow/source/engine/box2dtools.cxx:387:32: note: defined here: [loplugin:staticmethods] Box2DBodySharedPtr box2DWorld::makeBodyStatic(const Box2DBodySharedPtr& pBox2DBody) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I don't reproduce this with my build containing enable-dbgutil because the functions contain:

assert(mpBox2DWorld);

A general note, as such conditional cases of lopluign:staticmethods may be one of the more frustrating loplugin warnings to get cleaned up: Conditionally false positives can be silenced with something like

  (void) this; // avoid lopluign:staticmethods

in the member function's body, although <https://git.libreoffice.org/core/+/2e12d210cac8d031c21cdda9c37c1551f967ddc4%5E!> "Silence loplugin:staticmethods when the definition involves preprocessing" should already have reduced the likelihood of such conditionally false positives.

(In the given cases, though, it seems more plausible to get rid of the asserts, which appear to not state something of relevance for those functions, and indeed make them static member functions or even non-member functions.)


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.