summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2022-04-02loplugin:stringviewparam convert methods using compareToNoel Grandin
which converts to compare Change-Id: If03c790ea113a7caedbe89f926b29055c9ec1e76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin
.. and lastIndexOf, which convert to find and rfind Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-28-Werror,-Wunused-but-set-variableStephan Bergmann
...which was apparently meant as a "Possible debugger breakpoint" in DBG_UTIL-only sw_DebugRedline. The obvious fix is to mark nDummy as volatile, but increment of a volatile variable is deprecated, so replace those with reads of the variable, but which triggered false loplugin:casttovoid so fix that too. Change-Id: I07376e665caa4fd9befaba06d261a50df7a63a10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132237 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28Drop support for OpenGL denylist on X11Stephan Bergmann
...which appears to have become even less relevant with db89f53c31af997b9bf422b0e784afba8d62a42e "remove OpenGL VCL backend code". And the vcl/unx/glxtest.cxx machinery that it is based on is (a) known to cause issues like <https://gitlab.freedesktop.org/mesa/mesa/-/issues/3957> "LibreOffice's OpenGL version detection code hangs when running inside a flatpak container with a different mesa version", and (b) is one of the two reasons why an soffice that uses Wayland nevertheless also requires Xwayland during startup (the other reason being oosplash). So getting rid of the glxtest machinery is beneficial. The remaining two potential uses of OpenGL on X11/Wayland are the obscure css.rendering.SpriteCanvas.OGL service implementation (about which db89f53c31af997b9bf422b0e784afba8d62a42e states that "it seems has never been finished or enabled (or so it most probably should be dumped too)") and some slideshow transitions. About the latter, Caolán stated on IRC: "I think we grew this set of stuff to check for dodgy opengl primarily for the case where vcl used opengl for ordinary UI optimizations; but I think that use is gone now so I wonder does it make sense to just drop all of that entirely; for just slide transitions we apparently survived fine without the denylist for ages". (And in any case there is still the WatchdogThread support with OpenGLZone::hardDisable in VCLExceptionSignal_impl, vcl/source/app/svmain.cxx, should any OpenGL code run into problems.) (The removal of gb_LinkTarget_use_glxtest from gb_LinkTarget_use_vclmain, which indirectly brought in gb_LinkTarget_use_libraries,*,vcl, revealed that an explicit use of vcl was missing from various Executables etc., which thus had to be added now.) Change-Id: Ifa5220fd09910a4459ca546d9655e479a2e38f1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131943 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-28Adapt loplugin:singlevalfields to AtomicExprStephan Bergmann
> AtomicExpr 0xcb01120 'std::__detail::__platform_wait_t':'int' > |-ImplicitCastExpr 0xcb01108 'std::__detail::__platform_wait_t *' <LValueToRValue> > | `-MemberExpr 0xcb01048 'std::__detail::__platform_wait_t *' lvalue ->_M_addr 0xcafd9c8 > | `-CXXThisExpr 0xcb01038 '__waiter_base<_Tp> *' implicit this > |-IntegerLiteral 0xcb01098 'int' 5 > `-IntegerLiteral 0xcb01078 'int' 1 > AtomicExpr 0xd1e2d08 'std::__detail::__platform_wait_t':'int' > |-ImplicitCastExpr 0xd1e2cf0 'std::__detail::__platform_wait_t *' <LValueToRValue> > | `-MemberExpr 0xd1e2cc0 'std::__detail::__platform_wait_t *' lvalue ->_M_addr 0xcb02bf8 > | `-CXXThisExpr 0xd1e2cb0 'struct std::__detail::__waiter_base<struct std::__detail::__waiter_pool> *' implicit this > |-IntegerLiteral 0xcb01098 'int' 5 > `-IntegerLiteral 0xcb01078 'int' 1 > error: 'error' diagnostics seen but not expected: > File ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/atomic_wait.h Line 312: oh dear, what can the matter be? [loplugin:singlevalfields] > File ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/12.0.1/../../../../include/c++/12.0.1/bits/atomic_wait.h Line 312: oh dear, what can the matter be? [loplugin:singlevalfields] Change-Id: I71c43b482aaa0992b7ce131d27e262b8e3b4087f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132160 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-25loplugins ignoreLocation() is unreliable with PCHNoel Grandin
Change-Id: Ic12cacb6e058a8725ea6d722399e3afe6ea458c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132115 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24Adapt loplugin:trivialconsructor to clang-clStephan Bergmann
...where the S4 template constructor may still have an unparsed null body, so if (!constructorDecl->hasTrivialBody()) return true; will suppress the expected warning. Lets just accept that clang-cl on Windows will find less instances of loplugin:trivialconstructor. (And moving the expected-error comment around on the line was demanded by clang-format. Oh my.) Change-Id: I3357fbd0fbf932f7f93c421c2f079a8cfc536eef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132019 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-24loplugin:constantparam improvementsNoel Grandin
(1) sanitize call value output, make downstream processing easier (2) remove bad ignoreLocation() call, which was eliminating a lot of valueable data and thus generating false positives Change-Id: I39230c260c5cf717559300913fbc68bc3485b957 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131986 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-23loplugin:unusedfieldsNoel Grandin
Change-Id: Ifa2e2b35b725a877ef43526ad243cbfd02148807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-22Adapt loplugin:indentation to --enable-qt6Stephan Bergmann
> In file included from vcl/qt6/QtClipboard.cxx:10: > vcl/qt6/../qt5/QtClipboard.cxx:142:16: error: statement mis-aligned compared to neighbours [loplugin:indentation] > Q_EMIT clearClipboard(); > ^ etc. Change-Id: I8ceacfd5eafe963699d8313d3f8cadbed4ccd260 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131929 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-22Win/X11OpenGLDeviceInfo don't need a common base classStephan Bergmann
Change-Id: I9fc7e763b8cf055c3aabaaa97fe8c85ebc5e71b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131926 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-16Consistently avoid loplugin:trivialconstructor when there are defaulted paramsStephan Bergmann
(The template default constructor in S8 had already been suppressed via std::distance(recordDecl->ctor_begin(), recordDecl->ctor_end() being zero, but the similar case in S7 caused a warning.) Change-Id: I4d18dec8bb971198eb8503262572a08c019c66bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131663 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-16Fix loplugin:trivialconstructor handling of ctor templatesStephan Bergmann
Change-Id: Ic8b2f26498099c77b834d8e152f06d2834dfee3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131658 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15Simplify loplugin:trivialdestructorStephan Bergmann
The recursive checking of (non-virtual) bases and the checking of all virtual bases were unnecessary. It suffices to just check whether all the direct (virtual and non-virtual) bases have trivial destructors. (And FieldHasTrivialDestructor*Body* was a misnomer, as it actually checks whether the corresponding type has a trivial destructor.) Change-Id: I8a70e18eea4b629ad56577fa885f51925f9d7dde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131608 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15loplugin:trivialdestructor: Remove spurious anonymous union special caseStephan Bergmann
No idea what this "The destructor for an implicit anonymous union member is never invoked" block was meant to be good for. If a union-like class X has a variant member Y with a non-trivial destructor, an (implicitly-declared) defaulted destructor of X would be defined as deleted, so we must not warn about a user-provided destructor of X with an empty body. But that is already covered by the fact that the anonymous union of which Y is a member will have a non-trivial destructor if Y has a non-trivial destructor. Change-Id: Ia30381a07fadd3132f5595575716c6c5097fa34d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131576 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15Check that loplugin:trivialdestructor doesn't warn about deleted dtorsStephan Bergmann
...which happens to be covered by if (!destructorDecl->hasTrivialBody()) return false; Change-Id: Ica2874e710da08d668b7e773373a1188a8ae16a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131575 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-15loplugin:trivialdestructor: Only warn about definitionsStephan Bergmann
Change-Id: I666e72a5c95b48cd5bc0cb775de3ec6a6c82fe39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131574 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-03-14new loplugin:trivialconstructorNoel Grandin
Change-Id: Iaaf63c49ce94987ab9c4ebc68e963cc3054a3c34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131342 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-11load ods/xlsx with full row attributes without allocating all columnsLuboš Luňák
If there's e.g. an entire row bold, it's enough to set default attribute for unallocated columns. This also reverts the workaround from commit 297ab561c6754, as it's no longer necessary. Change-Id: I0b208709aeaff1c0d59da2410926876715cfe642 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131320 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-11new loplugin:trivialdestructorNoel Grandin
look for potentially trivial destructors that can then be elided Change-Id: I435c251bd4291b5864c20d68f88676faac7c43fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-25Don't use Library_tl in URE librariesStephan Bergmann
This partly reverts 8b5e23eac31cafbd442a3acab5fbcf98bfd0af11 "log nice exception messages whereever possible", e1eb7cb04a4c30cec238ab0f54d41a6cdc3299c1 "loplugin:logexceptionnicely in starmath..svgio", d6d80c4e1783b4459bd4a8fbcbdfeebe416c1cb5 "OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTION", and 877f40ac3f2add2b6dc37bae280d4d98dd102286 "tdf#42949 Fix new IWYU warnings in directories [h-r]*", and adapts loplugin:logexceptionnicely accordingly. Change-Id: I792b853b988c7c5f77179ca0672c30cb4223b5a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130502 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-18first cut at using Gtk4 built in video playbackCaolán McNamara
Change-Id: Ib996cd3f5ddbf20a81cdbe4b1c6546d6df478fde Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129783 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-17Revert "Fix failure of loplugin:useuniqueptr with older compilers"Stephan Bergmann
...0bf61855164af5751e78ca8626c10d604b1ab13b, which should be obsolete now: It speculated why 05a337e297eb0cfe88c99503d760bd9eaf495b7d "loplugin:useuniqueptr look for deleting in loops with iterators" had introduced Foo24 in compilerplugins/clang/test/useuniqueptr.cxx wrapped in #if CLANG_VERSION >= 50000 and came to the conclusion that "either the old compiler lacked Clang's recent <https://reviews.llvm.org/D50666> "Fix Stmt::ignoreImplicit" (and the above initialization expression happens to include a CXXBindTemporaryExpr, at least with libstdc++), or an even older compiler was used in pre-C++17 mode". But both of those potential reasons should be moot now, as the Clang fix got introduced towards Clang 8, and LO requires C++17 now (except for 3rd-party code). Change-Id: I307afbbecc5f031bca2319c4b22d54bd467eac81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130116 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17Don't exclude vcl/source/app/salplug.cxx from loplugin:externandnotdefinedStephan Bergmann
Whatever exactly the original reason to do so, it appears to no longer be relevant. (Maybe that salplug.cxx got reworked in the meantime?) Change-Id: I5187635dcb095ca505b38992b19770fe232f5124 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130115 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17Extend loplugin:stringview to O[U]StringBuffer::makeStringAndClearStephan Bergmann
...at least when called on an rvalue. (The lvalue case would often be trickier to act upon, if the cleared object is still used later on.) Change-Id: I006e618da004b2127e9ed7381911c2d7b00b1169 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130110 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17Bump compiler plugins Clang baseline to 12.0.1Stephan Bergmann
...as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html> "Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html> "Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up compilerplugins/clang/ accordingly Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17loplugin:unusedfieldsNoel Grandin
Change-Id: I07ec409ea3663e789b6505dbfc999666525ed97f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-17loplugin:unnecessaryvirtualNoel Grandin
Change-Id: I44c70bd930380d0e3f76524f37e6276cf4faeccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130061 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-16Extend loplugin:stringview to OUStringBuffer::copyStephan Bergmann
(Somewhat oddly, there is no OStringBuffer::copy counterpart.) This required some modification to StringView::VisitCXXConstructExpr to avoid > In file included from odk/qa/checkapi/checkapi.cxx:29: > In file included from workdir/CustomTarget/odk/allheaders/allheaders.hxx:351: > In file included from instdir/sdk/include/rtl/math.hxx:31: > instdir/sdk/include/rtl/ustrbuf.hxx:1687:16: error: rather than copy, pass with a view using subView() [loplugin:stringview] > return copy( beginIndex, getLength() - beginIndex ); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ while building CppunitTest_odk_checkapi as external C++03 code, where the returned value is wrapped in a CXXConstructExpr. And testing for that case required a new CompilerTest_compilerplugins_clang-c++03 that uses gb_CXX03FLAGS and needs to not set LIBO_INTERNAL_ONLY (via gb_CompilerTest_set_external_code), as compiling as C++03 would otherwise generate lots of errors like unknown char16_t at include/sal/types.h:118. (There was a choice whether to name the new test "-c++03" or "-external", but the issue it tests is caused more by the code being compiled with C++03 than by this being external code, see above.) Change-Id: I873a9c5a70d3ea949cf13a169d46920b71282712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130036 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15Fix a CLANG_VERSION checkStephan Bergmann
These functions became available with <https://github.com/llvm/llvm-project/commit/a32a2e34431480759d4983949cbcc25456c6199b> "[clang] Move two utility functions into SourceManager" towards Clang 8 and <https://github.com/llvm/llvm-project/commit/5ef88bdb68234b21b2ecda683dfe2f76513502d9> "Fix isInSystemMacro to handle pasted macros" towards Clang 9 Change-Id: I95b20bc88ff416b49502bdea23e223e6fa966eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129970 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15Properly implement compat::isComparisonOpStephan Bergmann
...using clang::CXXOperatorCallExpr::isComparisonOp introduced in <https://github.com/llvm/llvm-project/commit/fc3c80c38643aff6c4744433ab485c7550ee77b9> "[ASTMatchers] adds isComparisonOperator to BinaryOperator and CXXOperatorCallExpr" towards Clang 11 Change-Id: Icc4b2a2fc3f944b8c262ec5fea0bb2295fc051bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129968 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15Remove unused includesStephan Bergmann
...after 9663341f9249c739219ffe6cccf3762aa8dd78f3 "Bump --enable-compiler-plugins to Clang 3.8.0" removed the uses of clang::PPCallbacks and clang::Preprocessor, and f23aa1a51cb1beea4ebe3a61ba0c9b3abd844fd9 "Bump compiler plugins Clang baseline to 5.0.2" removed the uses of clang::CompilerInstance, llvm::StringRef, and std::size_t. But llvm::sys::fs::OpenFlags needs llvm/Support/FileSystem.h. Change-Id: I98227554646843db5cc13f75a2baed51be752dbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129962 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-12Fix some tautological std::type_info (in-)equality comparisonsStephan Bergmann
...which could never succeed. I became aware of this when Clang 15 trunk -std=c++2b, implementing <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1328r1.html> "Making std::type_info::operator== constexpr", pointed at two of the broken comparisons with > sw/source/uibase/app/docsh2.cxx:478:25: error: code will never be executed [-Werror,-Wunreachable-code] > pTmpFrame->GetFrame().Appear(); > ^~~~~~~~~ > sw/source/uibase/app/docsh2.cxx:475:33: error: code will never be executed [-Werror,-Wunreachable-code] > bOnly = false; > ^~~~~ (It didn't emit warnings pointing at any of the other broken comparisons, though.) All of these broken comparisons were regressions introduced with 89d39bc100aabf5dccbe77c0b5c0c85736e85b39 "tdf#94559: 4th step to remove rtti.hxx", replacing uses of the IS_TYPE macro (from include/tools/rtti.hxx, meanwhile removed with d64e535fe9a00b671cf1be3eb5632c0d5f4b8bea "Remove unused rtti.hxx"). I now added loplugin:typeidcomparison to also find the other broken comparisons introduced by that commit. (The remaining cases where that commit replaced uses of TYPE_INFO with typeid comparisons were correct and/or have meanwhile been replaced with code not using typeid, see 553ee72041d6f66e26156eb1ad0d9e3c13457f7a "simplify some use of typeid" and d656da9bc4f2df0bb99c65a288847e3fdd43a37c "~SwModify: do not silently tolerate clients registered past death".) The original IS_TYPE macro made sure not to dereference null pointers, > #define IS_TYPE(T,pObj) \ > ( pObj && (pObj)->Type() == TYPE(T) ) I don't know if any of the pointers now dereferenced in those typeid expressions can legitimately be null. But to be on the safe side, I replicated that check in the newly introduced isType (sw/inc/istype.hxx). (It is interesting to note that none of the static analysis that we routinely employ seems to have noticed these broken comparisons.) Change-Id: I65baffdd27bac1abf744283ff98c2dc864fa63b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129865 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-09clang::IfStmt::getCond can return nullStephan Bergmann
...for C++23 consteval if statements. (These caused CompilerTest_compilerplugins_clang tail fail with > clang++: include/llvm/Support/Casting.h:104: static bool llvm::isa_impl_cl<clang::DeclRefExpr, const clang::Expr *>::doit(const From *) [To = clang::DeclRefExpr, From = const clang::Expr *]: Assertion `Val && "isa<> used on a null pointer"' failed. assertions.) Change-Id: I095469c8327f91107110e5ed426b95bb41ae26b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129740 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-08Extend loplugin:stringview to O[U]StringBuffer::toStringStephan Bergmann
Change-Id: I7ad212dfff8b34d05e3b45107a1ef033a4efc454 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129651 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-02Fix typoAndrea Gelmini
Change-Id: I2532e97d2f7b4808832ef1ead5a928885ff7c3c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129317 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-20WASM open links in new browser tabsJan-Marek Glogowski
I quickly gave up trying to understand what exactly clashes between the Emscripten macros and OUString templates / initializers. Not sure it can actually be "fixed". Also disables the makeshared clang compilerplugin; currently there is no way to get rid of all the false positive hits when assigning the std::shared_ptr from a function instead of a constructor call. Change-Id: I8b13f179629ea63ff221584030556d2bedadc01b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128604 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-19Drop unused loplugin:externandnotdefined suppressionStephan Bergmann
...that was added with the initial dac4ca5f682fdd0c3eee7f7ee1d98c9b3c8b7ce4 "new loplugin: externalandnotdefined" but doesn't appear to trigger any false positives when compiling the relevant source files Change-Id: I7ff8f49209ee426b87c89e1e64efb33eb98bf982 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128562 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-19Let CppunitTest_odk_checkapi build against the SDK include directoryStephan Bergmann
...which contains only the URE include files, rather than against the SRCDIR one which contains many more. This would have prevented 148536afc9838398100ca2267b99ab349dcbb38c "Drop config_global.h from osl/module.h", where an URE include file had accidentally started to include a non-URE file. (The way $(INCLUDE) is now set up in odk/CppunitTest_odk_checkapi.mk is a bit hacky, and this change required teaching compilerplugins about SDKDIR to avoid false warnings. Another approach would be to make the test compile in the SDK build environment, similarly to CustomTarget_odk/build-examples, but setting up the SDK build environment from within gbuild is not supported at least on Windows for now. A smaller improvement would be to drop the need to include any CppUnit include directories, by turning the test into some kind of compile-only test similar to a gb_CompilerTest.) Change-Id: If79761909c67c3162d01f847dfb5d4f538f91ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128591 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-17iOS+SVP convert remaining VCL plugins to salplugJan-Marek Glogowski
While this makes the preprocessor usage even larger, the code in salplug.cxx is now hopefully easier to follow. I added a comment about the main code structure at the beginning. It also includes changes to the generic plugin list to include gtk3_kde5 before gen, qt5 and qt6 after gen, but still skips the headless / svp plugin. And I explicitly excluded salplug.cxx from the externandnotdefined compiler plugin. I could have added a dummy, but that seemed not worth the effort. My try on a non-dummy with correct includes and defines made the code in salplug.cxx much harder to follow. FWIW, the iOS VCL plugin actually seems to use the osx SalData, so I think these changes to iosinst.cxx are more correct then commit 7d990aafdc363b2a12b5db78637d7f3bef7780bd ("VCL drop m_pInstance from *nix SalData"). But hard to tell without a compiler. Change-Id: I0e2944d4221ca5910fb2120cc8b24def5c5b3f33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128477 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-15Let loplugin:nullptr look into template instantiationsStephan Bergmann
It missed some occurrences of 0 when only looking into uninstantiated template code, as Clang doesn't model them with an ImplicitCastExpr, even if the target is known to be a (dependent) pointer type. Looking into all template instantiations of course carries the risk that a given use of 0 is meant to be interpreted as a pointer in some and as an integer in other instantiations. But the only case where that happened in the current code base is RegistryValueList::getElement (include/registry/registry.hxx), where {} is arguably a better choice anyway. (And which would presumably also hold for any future such cases.) Change-Id: I708bcfc8bedc0a49c9282d7814eb325afa29905c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128462 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-03loplugin:unusedmethodsNoel Grandin
Change-Id: I922778e8ced0ad922d90a153b0eda47abbec94ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127868 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-02loplugin:unusedfieldsNoel Grandin
Change-Id: I20a387563a0f65bc9a7149ab0b08b09f1946e9ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127867 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-02loplugin:unnecessaryvirtualNoel Grandin
Change-Id: Ia7d68c07d44aaa9ce44fe4e7ed72987e96433269 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127866 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-01Bump copyright year to 2021Adolfo Jayme Barrientos
Change-Id: Icbb000677066127fa67e8c22fb0ab6880acc0169
2021-12-21Fix loplugin:unusedvariablecheckStephan Bergmann
...on macOS, where it started to cause false positives like > vcl/inc/osx/a11ywrapper.h:89:98: error: unused parameter 'anAccessibleContext' [loplugin:unusedvariablecheck] > -(id)initWithAccessibleContext: (css::uno::Reference < css::accessibility::XAccessibleContext >) anAccessibleContext; > ^ after a214369f14d3f53d45b1889827057882c0ffd62e "loplugin:unusedvariablecheck improve" Change-Id: I450df3a6d768b4452d0975b5920ea0b3ce53ce13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127220 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-18Fix loplugin:unusedvariablecheckStephan Bergmann
...after a214369f14d3f53d45b1889827057882c0ffd62e "loplugin:unusedvariablecheck improve", so that it doesn't cause false positives for > CoIfPtr<IADsADSystemInfo> aADsysGuard(pADsys); and > CoIfPtr<IADsUser> pUserGuard(pUser); in (Windows-only) extensions/source/config/WinUserInfo/WinUserInfoBe.cxx, where the CoIfPtr default constructor is > CoIfPtr(If* p = nullptr) Change-Id: I6107fa8d8aa7244b2fc5c50df2baea5096d46214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127017 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-17loplugin:unusedvariablecheck improveNoel Grandin
to find unused smart pointer variables Change-Id: I200bdd8949032a0e061de61f7903a156651793e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127006 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-15ucb: remove --with-webdav=neonMichael Stahl
Remove code in ucb/source/ucp/webdav-neon, and now unused external neon. The --with-webdav=no option is retained for now. Change-Id: I4ce429587e3991fa82009da2f8e4a068abe36435 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126839 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-12-13Adapt CompilerTest_compilerplugins_clangStephan Bergmann
...to Clang 14 trunk <https://github.com/llvm/llvm-project/commit/53219009aaebd2c26028c1df05550183a94c489c> "[clang][clangd] Desugar array type." Change-Id: I6b7e09e4789aa68a679affd7b3c6342409e66af8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126740 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>