summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2018-03-06tdf#114596 dbaccess: fix mysterious dataloss bugMichael Stahl
OBookmarkContainer actually re-uses the reference count of ODatabaseSource, so converting ODatabaseSource::m_aBookmark to Reference created a cycle, which somehow causes the dataloss, because evidently something as important as storing the data must be done in the destructor. (regression from 2660d24a07866e083c5135ea263030f3e3a2e729) (cherry picked from commit 96ae2a3300811897c24cccb20f8c2faf382483df) tdf#114596 compilerplugins: add exception to [loplugin:refcounting] (cherry picked from commit e80da60895b45309fa1d018760d5f11cca4367f4) Change-Id: I4cad01dc9cdaf405c1eb31d6c0e161eb6712b78f Reviewed-on: https://gerrit.libreoffice.org/49026 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit b5440ce23b17d84f7971cb7ea35512d5cac69c9f)
2018-01-18lokdialog: Make the badstatic loplugin happy.Jan Holesovsky
Change-Id: Ic19bbd2a3533e4e600d8856e55c4e8d06f0ad752 Reviewed-on: https://gerrit.libreoffice.org/45500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit 8ce967ad157d83ad567c5f8c750f4225dd974219) Reviewed-on: https://gerrit.libreoffice.org/48088 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
2017-12-18Silence new loplugin:fpcomparison for nowStephan Bergmann
...introduced with ba4a124b0c0c66fd275f5147d55eeec27ce78da9 "Resolves: tdf#114117 draw page shadow mangled" Change-Id: I31573d55ae7e5ff015d4582de1d436cdc673acf1 (cherry picked from commit bc4e8de8eea1ccebda479c8e2db2f3c6dfff60d2) (cherry picked from commit 7545466b43175bbf3c850a82e2e65aa1a47d8005)
2017-12-05Fix typosAndrea Gelmini
Reviewed-on: https://gerrit.libreoffice.org/42726 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit e44c188a7353cc183fac8ece0cbf3611d842835e) Change-Id: I879a52820d78d9151ef64dd21612379f617f66e2 Reviewed-on: https://gerrit.libreoffice.org/45454 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 50e37a41acae8597fdb097715f8b76b16bce9f31)
2017-12-05loplugin:useuniqueptr extend to check local varsNoel Grandin
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 2489000d3fd66319a8355fd4e37cfdfda47296d0) Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 (cherry picked from commit e540ccfb5eb43bd4a3d6920074dce8436720ba8e)
2017-12-05new loplugin useuniqueptrNoel Grandin
Change-Id: Ic7a8b32887c968d86568e4cfad7ddd1f4da7c73f Reviewed-on: https://gerrit.libreoffice.org/33339 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 98e4013c22c4ce63090a575e698cc2af82925e6b) (cherry picked from commit 051b2fbdad2a4b18f6d4b30134438e11fb9bec64)
2017-12-05loplugin field-can-be-private in include/vcl..xmlscriptNoel Grandin
Reviewed-on: https://gerrit.libreoffice.org/31069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 29a9e97db65bcf5914aed9bf8cb8e8f38c3c5fc0) (cherry picked from commit 330dc55f4923bb88c3e7dbc75a2c935477b92928) Change-Id: Ia03f7cccb256d825daa4dc6f4c0598448e46e6cf
2017-09-12tdf#108572 remove connections only for current shellSzymon Kłos
Also remove connections to temp files. Change-Id: Ie5c09eb365d1246e053dc52884c72687ac226f3c Reviewed-on: https://gerrit.libreoffice.org/42095 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/42208 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
2017-02-20SAL_DEBUG_TRACE is like SAL_DEBUGTor Lillqvist
Change-Id: I7b4585259255b9869e5f6ec03fc901db29c10bc8 Reviewed-on: https://gerrit.libreoffice.org/34481 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit 962c820d34d0e00dc3d947b17db752110cf35e40)
2017-02-18loplugin:vclwidgets check for assigning from VclPt<T> to T*Noel Grandin
Inspired by a recent bug report where we were assigning the result of VclPtr<T>::Create to a raw pointer. As a consequence, we also need to change various methods that were returning newly created Window subclasses via raw pointer, to instead return those via VclPtr Change-Id: I8118e0195a5b2b4780e646cfb0e151692e54ae2b Reviewed-on: https://gerrit.libreoffice.org/31318 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit e6ffb539ee232ea0c679928ff456c1cf97429f63)
2016-12-19vcl: separate ImplImageTree - ImageTree singleton and public ifaceTomaž Vajngerl
ImplImageTree was used outside of VCL which is not consistent with the name and the header also contains a lot of implementation detail. This separates the implementation to ImplImageTree and the public interface and singleton to ImageTree only. Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e Reviewed-on: https://gerrit.libreoffice.org/32134 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit bf5f6df9e47bd31dc052c6411f6f88ec2d4e3cea) Reviewed-on: https://gerrit.libreoffice.org/32165
2016-11-22New loplugin:oslendianStephan Bergmann
...to catch new places where defined'ness of OSL_BIG/LITENDIAN would be checked without osl/endian.h being included; cf. e2f08f9def0869460ad38a1c2adb450778290f6e "connectivity, sc: add missing #include <osl/endian.h>" and 2b14fb3a4f92b928f0a5fc536c6a5f4a6e51a9b8 "cppcanvas, oox: add missing #include <osl/endian.h>". Change-Id: I167c8916a01391b7dacad7325153ccf35d3ba9dc
2016-11-22can-be-private analysis needs to ignore virtual methodsNoel Grandin
Change-Id: I1e2f28ed550ff9751912f70e3eec511ddc5b75cf
2016-11-21FieldDecl::getParent fires assert for Objective C @interface membersStephan Bergmann
(like in vcl/inc/osx/a11ywrapper.h's AquaA11yWrapper), at least on recent Clang trunk, from within the call to cast() in cast<RecordDecl>(getDeclContext()) as the decl context apparently is something other than a RecordDecl. Change-Id: I238bae44d6db0f04bf8f90b0032489e3b4822eee
2016-11-21new loplugin datamembershadowNoel Grandin
Change-Id: Ib14319848bafd1fe7e0e663c434bbdeef5e98ecf Reviewed-on: https://gerrit.libreoffice.org/30963 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-17extend unusedfields loplugin to find fields that can be privateNoel Grandin
and apply the results in xmlscript Change-Id: Ib126f6e1576639abfd171e99d9561be9715ece2f
2016-11-16update couple of loplugins for move constructorsNoel Grandin
Change-Id: I82140569a3e09225065d721e4aeac5c5fe93bc45
2016-11-16Reduce noise for irrelevant warnings somewhatStephan Bergmann
...other options to avoid such irrelevant warnings can be to move code to an include file and/or to define a dummy main() accessing otherwise unreferenced entities. Change-Id: Ifd44e376b35ef68496f3aba6a3c046d684824000
2016-11-16new loplugin finalprotectedNoel Grandin
look for final classes, and make sure they don't have protected members Change-Id: I1fa810659bba02b61a5160dbfd8e24185ec9abf4 Reviewed-on: https://gerrit.libreoffice.org/30895 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-15New compilerplugins/clang unit testsStephan Bergmann
...to check that loplugin produces warnings/errors as expected: * Clang has a -verify switch that makes it easy to write test input .cxx files that list in comments all the warnings/errors that are expected, and let Clang check those expectations instead of generating object code. See include/clang/Frontend/VerifyDiagnosticConsumer.h in the Clang source tree for documentation. * Introduce a CompilerTest gbuild class that uses the existing LinkTarget class as much as possible. Checking the input files is implicitly phony, as the compilation step doesn't generate any object files, and the link step does nothing because there is no gb_LinkTarget_set_targettype for CompilerTest. The setup at least works for Clang on Linux (will need adaptions for Clang on Windows; compilers other than Clang are not relevant for now given this is used to check compilerplugins). * Definition of gb_CFLAGS_WERROR in solenv/gbuild/platform/com_GCC_defs.mk needs to be lazy ('=' vs. ':=') so that CompilerTest can override it: The Clang -verify mode wants the input files to specify whether the loplugin diagnostics are warnings or errros, so they consistently need to be errors independent of --enable-werror configuration. * A first (example) test is in compilerplugins/clang/test/salbool.cxx. The corresponding gbuild CompilerTest instance is in solenv/CompilerTest_compilerplugins_clang.mk for now. The reason for that odd split across compilerplugins/ and solenv/ is that there is no compilerplugins/Modules_compilerplugins.mk file, so this setup is the easiest hack for now (to be cleaned up). (Another area that could be improved is that all test files need to be listed explicitly in the CompilerTest_*.mk file, instead of, say, using all .c/.cxx/.m/.mm files in a specified directory.) * The test is run somewhat late during a top-level 'make', after loplugin has already been used in compilation. But it can be run manually (e.g., 'make solenv') when making changes to loplugin during development. Change-Id: I01e12fb84887d264ac03ef2484807458c2075af4
2016-11-14CXXDestructorDecl is already handledStephan Bergmann
...a few lines up, together with CXXConstructorDecl Change-Id: Id9afd4d3936b2efb92de3c6ab950da78d876a5a8
2016-11-14ignore constructors for method-can-be-private analysisNoel Grandin
doesn't work right now Change-Id: I43693104f4af204a6bd0c22b0f7ef53c1a14bb6e
2016-11-14tdf#68118: Pass current document frame to SvxScriptSelectorDialogMike Kaganski
... through MacroChooser Without this, current document's macros library is unavailable in "Assign" dialog Change-Id: I83baa3b98858260eab61e8f4fefde3f9979c6d83 Reviewed-on: https://gerrit.libreoffice.org/30600 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-11-11update vclwidget loplugin to find ref-dropping assigmentNoel Grandin
Look for places where we are accidentally assigning a returned-by-value VclPtr<T> to a T*, which generally ends up in a use-after-free. Change-Id: I4f361eaca88820cdb7aa3b8340212db61580fdd9 Reviewed-on: https://gerrit.libreoffice.org/30749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08loplugin:oncevarNoel Grandin
Change-Id: I44fb6858eeff14fcbd9fdfbbb0aabd1433b6a27d Reviewed-on: https://gerrit.libreoffice.org/30668 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-04move loplugin:defaultparams to store/Eike Rathke
As per IRC 2016-11-04 12:21 Change-Id: Ic4cc7f67fb31be80a966c652cb30bb859f874a8b
2016-11-04-Werror=unused-functionStephan Bergmann
Change-Id: I33790862cfe40693921d07182ccf4645c3ef28a3
2016-11-04update loplugin:unnnecessaryvirtual to handler destructorsNoel Grandin
and update modules writerfilter..xmloff with the resulting changes Change-Id: I54d19c22ddb0ff579b32e4934d266c925b19305c Reviewed-on: https://gerrit.libreoffice.org/30530 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-02loplugin:unusedfieldsNoel Grandin
Change-Id: I96634c18ba6600f8f7d5d04a162dcd7e1e312923 Reviewed-on: https://gerrit.libreoffice.org/30474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-01disable this chunk of loplugin code on clang < 3.8Noel Grandin
not worth the spaghetti of making it work across version Change-Id: I0de923b16fb6d58cbad55adc9878ab39bc0c86ae
2016-10-31loplugin:vclwidgets: Adapt iterator hack to libc++Stephan Bergmann
Change-Id: I1e4fbb06578b2b1d6de4b57507693b014d36cd3a
2016-10-31No good reason for dbaccess::OCacheSet::updateRow to be pure?Stephan Bergmann
Most of its virtual member functions are (though insertRow is already a curious exception), even though they are defined, so smells like a copy/paste error rather than deliberate design. And appears to have been the only reason why loplugin:unnecessaryoverride filtered out such overriding of pure base functions. Change-Id: Ib2a40af9cd3cd3dbb26c4147f7d01de4e11f5f6e
2016-10-31fix unnecessaryoverride clang plugin on clang < 3.8Noel Grandin
Change-Id: Id78d694cf7271a6abf94234958ab623cf1cd93a5
2016-10-31update vclwidgets plugin to check local variablesNoel Grandin
Change-Id: I91f7fc6b8419c0ed82194726eeb4c4657e998f22 Reviewed-on: https://gerrit.libreoffice.org/30428 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-30Rename ServerFont to FreetypeFontKhaled Hosny
This is what it is actually is, we dropped support for server-side fonts for a long time now. Renamed also a few related classes, but left ServerFontLayout* ones as they will go away soonish. Change-Id: I68a6dad51b6972368b7bf85a0b9c8089cc12740e Reviewed-on: https://gerrit.libreoffice.org/30390 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-10-28update unnecessaryoverride plugin to find pure forwarding methodsNoel Grandin
which can be replaced with using declarations. Is there a more efficient way to code the search? Seems to slow the build down a little. Change-Id: I08cda21fa70dce6572e1acc71bf5e6df36bb951f Reviewed-on: https://gerrit.libreoffice.org/30157 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-28Various loplugin warnings in --enable-telepathyStephan Bergmann
Change-Id: I4c437491466c3029f2a9c93fb630c7b5a8d2ff21
2016-10-21The badvectorinit plug-in probably can be retiredTor Lillqvist
Let's hope it only catches false positives now. noelgrandin agrees. Change-Id: Ibd8310c31897aa6835bd6aaf90a49b5cd8f92948
2016-10-20fix bug in expandablemethods pluginNoel Grandin
where using a std::map instead of a std::set meant that it sometimes miscounted the number of callsites Change-Id: I1e2ebcf44fe006827e66620ae4c9bbc813835414
2016-10-19Plugin::isInUnoIncludeFile should not cover WORKDIRStephan Bergmann
...that got in, for no apparent reason, when various, slightly different implementations of isInUnoIncludeFile got consolidated into one. Change-Id: I64a9eb62703d57a0b7b57720ec9f251ffa780691
2016-10-19accidentally left the expandablemethods loplugin activeNoel Grandin
Change-Id: Ifadab184876163195ea3307ec32d2eed4ee00b92
2016-10-19loplugin:expandablemethods in UnoControls..vbahelperNoel Grandin
Change-Id: Iec2c5e13119d97c9ca87e083c0f7cb00227e5231 Reviewed-on: https://gerrit.libreoffice.org/29997 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-18-Werror=unused-functionStephan Bergmann
Change-Id: I9e0585460d908024f75a1134bc1cd20d12ea3b4e
2016-10-18rename inlineablemethods plugin to expandablemethodsNoel Grandin
and add support for nested functions Change-Id: I63daee5b3047fa1ed5de0e5ddaf998f8b17bc780
2016-10-18loplugins: extract some common functionalityNoel Grandin
Change-Id: If470e1d9b481c9eda0829aa985152baf8fb46d7a
2016-10-18simplify inlineablemethods lopluginNoel Grandin
Change-Id: I72750a14664aa042da232c35cca3373ce367cfb0
2016-10-18some cleanups to the unusedmethods lopluginNoel Grandin
- publicDefinitionSet is unnecessary, the python post-processor does not need it - remove the traversing of templates, clang will do that for us since we have set the shouldVisitTemplateInstantiations() method Change-Id: I0e96dad0b1cc941fe6c4a2e9227e86d8c3f1d85a
2016-10-18new loplugin inlineablemethodsNoel Grandin
look for methods that are: (*) non-virtual (*) only called once (*) only called from inside their own class (*) small i.e. < 40 characters which are candidates for just having their code inlined Change-Id: I0e9e8125d140282cdcdd2a77374059b17b2fcd7d
2016-10-16clang::FileEntry::getName now returns StringRef on Clang masterStephan Bergmann
Change-Id: I94c9676e52a3c60ad70567396a8484e844176c6e
2016-10-14loplugin:mergeclasses merge TextView with ExtTextViewNoel Grandin
Change-Id: If7e11dd8f6b2cb6dc19c6aa3f7e50e2e88861eac Reviewed-on: https://gerrit.libreoffice.org/29828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>