summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2016-06-24Fix check for calls to OWeakObject::releaseStephan Bergmann1-8/+15
Change-Id: I90030dee12676eb356ebe2244358052cfcd725de
2016-06-24Adpat to <https://llvm.org/svn/llvm-project/cfe/trunk@273647>Stephan Bergmann6-6/+20
"Use more ArrayRefs" Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c
2016-06-24compilerplugins: add OWeakObject::release() override checkMichael Stahl1-0/+154
Change-Id: I767857545d7c91615cf162790c04f0016de9fdf6 Reviewed-on: https://gerrit.libreoffice.org/26555 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-06-24teach singlevalfields loplugin about function pointersNoel Grandin1-27/+58
Change-Id: I81f77e2b3f94c208866fa8d124b0b00ea5387563
2016-06-24Clean up OContainerListenerAdapterStephan Bergmann1-1/+0
* elide OContainerListenerAdapter_BASE * no need for protected members Change-Id: I70095dadc4b1f42f04c8ea76b2236bf99a226da9
2016-06-23loplugin singlevalfields, need to check default constructor code tooNoel Grandin1-0/+2
Change-Id: Idcc8de6f1d403a57c59e84774bd7a97e2f3fc224
2016-06-23-Werror=unused-functionStephan Bergmann1-27/+0
Change-Id: Ib579e8896a751383d31c1dbf7e6ebf5c0774a976
2016-06-23-Werror=unused-but-set-variableStephan Bergmann1-4/+0
Change-Id: I0b3586bb3acca4075b26790a8dfe3f97d6921feb
2016-06-23new loplugin: singlevalfieldsNoel Grandin3-2/+481
look for fields that only have a single constant value assigned to them Change-Id: Iafcd37fdb8a8119bbc00f92981a1a01badf9c5a2
2016-06-23compilerplugins: move oncevar into storeMiklos Vajna1-0/+0
As suggested by Stephan and agreed by Noel -- as its warnings are not useful in all cases. Change-Id: I3c6034ae9d3c74aeb089a67dc48c1f91a3ea3a21
2016-06-21compilerplugins: ignore GCC bridges more genericallyMichael Stahl1-4/+2
Change-Id: Ib76b14d37bbe3c32aa0637037d73d0d5dce01b25
2016-06-21compilerplugins: don't warn about __lxstat64Michael Stahl1-0/+1
Change-Id: I71e21d6aff55caa1bc3e8e25f0b4c60386120d00
2016-06-19loplugin:salbool: Implicit conversions from non-Boolean fundamental typesStephan Bergmann4-24/+81
Change-Id: I67eac95686678e6f5a2d60798535b2c65a9ba5d7
2016-06-17loplugin:override: No more need to request dtor be marked 'virtual'Stephan Bergmann1-1/+1
...rather than 'override', cf. <https://gerrit.libreoffice.org/#/c/26347/> "loplugin:override: No more need for the "MSVC dtor override" workaround". Change-Id: Ib528938ed4be248117bb7114f34d4e9421bc3275
2016-06-14Could swear I'd seen this produce a bogus compiler errorStephan Bergmann1-2/+2
...but now it apparently works Change-Id: Iac1b4e49788ac620ed55dec7a52c839ba2937f5b
2016-06-13Fix loplugin:passstuffbyref to not warn when ref param is bound to refStephan Bergmann1-16/+114
cf. d150eab88ee26d5c05a6d662a2c13c6adea8ad78 "loplugin:passstuffbyref: For now disable 'pass parm by value' warnings". At least all the other changes in 4d49c9601c9b3e26a336e08e057d299895683480 "Let loplugin:passstuffbyref also look at fn defn not preceded by any decl" were OK but the one reverted with b3e939971f56d53e60448a954a616ec295544098 "coverity#1362680 Pointer to local outside scope". Change-Id: I022125fbcb592e7da3c288c0fd09079dd2e87928
2016-06-13Remove unused member varStephan Bergmann1-4/+1
Change-Id: I0f4143cb2a34cf18e6c926432d707d84ef0ea579
2016-06-13loplugin:passstuffbyref: For now disable "pass parm by value" warningsStephan Bergmann1-0/+2
That needs fixing, to check that the parm is not bound to a reference, cf. <https://gerrit.libreoffice.org/#/c/26189/> "coverity#1362680 Pointer to local outside scope". Change-Id: I3656354ccd10affafa006c9e46cf1db608b5b2a7
2016-06-13Fix typosAndrea Gelmini1-1/+1
Change-Id: Ic3efae53430fbb2c1eb7962c3cf69bf99315e55b Reviewed-on: https://gerrit.libreoffice.org/26202 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-06-10loplugin:mergeclasses SfxMacroTabPageNoel Grandin1-1/+0
Change-Id: I74790c665fbd191914291365ce711fea9f1cf320 Reviewed-on: https://gerrit.libreoffice.org/26147 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-10loplugin:mergeclasses SdrItemBrowserNoel Grandin1-1/+0
Change-Id: I90c6006be05f182fd442ce8d3641f4f17cdb6793
2016-06-10update mergeclasses resultsNoel Grandin1-19/+35
and do one trivial merge Change-Id: Iff30553f73de946c74fa6b082928e7d47adadd04
2016-06-08Let loplugin:passstuffbyref also look at fn defn not preceded by any declStephan Bergmann1-6/+15
Change-Id: I752bc96d2d521d790e919283cabb14b6526626f4
2016-06-06Remove unneeded Pane code in Presenter ConsoleBryan Quigley1-4/+0
This code hasn't been touched (on purpose) in years, it appears to have been used to resize part of the console. (It's prefed off) Change-Id: Iaaeaa8a95c71ae91299bbeeea24869bf2a237b6b Reviewed-on: https://gerrit.libreoffice.org/24663 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-06-03Teach loplugin:stringconstant about RTL_CONSTASCII_STRINGPARAMStephan Bergmann3-0/+26
Change-Id: I8ff0e104aad045f3835dc8facc760a8339b1d088
2016-06-02I assume these special plugins were not intended to be enabled unconditionallyStephan Bergmann2-2/+2
...with fa135fd0e05fc4ba784b4349d65f2e5ed26c0f55 "remove unused SID constants and associated code" Change-Id: I51b2a9e3c8ce13401818bca0c40167a4364212f1
2016-06-01remove unused SID constants and associated codeNoel Grandin2-2/+2
found with a python script that looks like: process = subprocess.Popen( "git ls-files *.hrc | xargs grep -hE '#define +SID_' | cut -d ' ' -f 2 | sort -u", shell=True, stdout=subprocess.PIPE) for line in iter(process.stdout.readline, b''): line = line.strip() if line.startswith("//"): continue if line.startswith("sfx"): continue if len(line) < 10: continue i = subprocess.check_output("git grep -nP \"#define +" + line + " \"", shell=True) if i.count("#define") < 2: continue print line + " " + i Change-Id: I40eac2569c2b5b129d9459cb723a9d6f26d09264 Reviewed-on: https://gerrit.libreoffice.org/25715 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31fix KDE4 buildNoel Grandin1-0/+1
after 3d7325898547c94826cfdd "loplugin:unusedmethods" Change-Id: I32303948c5046b2880cd4e64cada32ea776a0861
2016-05-31loplugin:unusedmethodsNoel Grandin1-0/+2
Change-Id: Ifeb818227a960cab8fd2e8e7352468efbfe1232c Reviewed-on: https://gerrit.libreoffice.org/25668 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-31teach refcounting clang plugin about uno::ReferenceNoel Grandin1-27/+82
uno::Reference is only allowed to used with classes that have a ::static_type member. So convert all those places to rtl::Reference. Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and uno::Reference to make this a little smoother? Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3 Reviewed-on: https://gerrit.libreoffice.org/25516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-26loplugin:unusedreturntypesNoel Grandin1-56/+70
and clean up the python script Change-Id: I0a7068153290fbbb60bfeb4c8bda1c24d514500f Reviewed-on: https://gerrit.libreoffice.org/25439 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18update unusedmethods plugin to ignore externC and copy constructorsNoel Grandin1-2/+8
Change-Id: Idf7a9403d313ba6a0e031c59601e20c880b6118b
2016-05-18update vclwidgets loplugin to handle VclReferenceBaseNoel Grandin1-18/+20
Change-Id: I447cdb8c65d880b3c5ff28b35cefdc56ff784852
2016-05-18update unusedmethods plugin to deal with constructorsNoel Grandin4-24/+31
and fix the operator< implementations in some of the other plugins too. Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035 Reviewed-on: https://gerrit.libreoffice.org/25057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-16fix null pointer crash in loplugin:commaoperatorNoel Grandin1-12/+14
Change-Id: Ie077ed9a8f200b39da25938b35a3622e52cc5110
2016-05-06teach passstuffbyref plugin to check for..Noel Grandin1-24/+79
unnecessarily passing primitives by const ref. Suggested by Tor Lillqvist Change-Id: I445e220542969ca3e252581e5953fb01cb2b2be6 Reviewed-on: https://gerrit.libreoffice.org/24672 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-28move stylepolice back to storeNoel Grandin1-0/+0
recent updates did not meet with universal approval Change-Id: Ic059729797049361c7a8a4ae000cd39a5993f6af
2016-04-28loplugin:stylepoliceNoel Grandin1-0/+1
Change-Id: I151e4d94f1f5dc84ef3f91218686ca9d1b9bc36f
2016-04-28teach stylepolice plugin about ref-counted-pointer namingNoel Grandin1-11/+58
Change-Id: I6e91d22fc1826038c05ddb6fc065563c6a250752 Reviewed-on: https://gerrit.libreoffice.org/24459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-27cppcheck: silence warnings in compilerpluginsJochen Nitschke7-7/+7
mostly missing explicit before ctors and uninitialized member vars one odd use of std::find > compilerplugins/clang/implicitboolconversion.cxx > 800 stlIfFind warning Suspicious condition. > The result of find() is an iterator, but it is not properly checked. Change-Id: Iade53494cd7fe8ddb0e110e431449ae5a517fe3b Reviewed-on: https://gerrit.libreoffice.org/24398 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-27loplugin:stylepolice: adapt to libc++Stephan Bergmann1-0/+6
Change-Id: I8a471d0fb7a206f1a235c3019ae9d07b44056e01
2016-04-26Enable Clang plugin warnings in Bison source codeStephan Bergmann2-1/+5
-Werror is generally suppressed in Bison-generated C/C++ code (as in all other generated code) to silence warnings from the Bison skeleton code. And the Clang plugins suppress warnings in generated WORKDIR code based on the presumed source location (i.e., taking #line directives into account). So introduce a new PLUGIN_WARNINGS_AS_ERRORS mode where warnings from Clang plugins are reported as errors even if -Werror is suppressed. That way, any warnings in the Bison skeleton code still do not lead to compilation errors, while (at least plugin- emitted) warnings in the genuine source code do. Unfortunately this cannot also be enabled for Flex source code, as at least Flex 2.5.39 generates poor code that does not properly prefix all skeleton code with appropriate #line directives, so that some skeleton code would be mistaken for genunie source code, and compilation would fail due to errors. Also, %glr-parser Bison input appears to generate no #line directives at all (at least with Bison 3.0.4), so all of connectivity/source/parse/sqlbison.y is considered generated code and plugin warnings are still suppressed throughout. Change-Id: Id746e81cbfa5f77628b0a34c7b82780948e7db08
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin2-80/+142
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-25Lots of violations in gcc3_linux_x86-64/share.hxx, too, when using libc++Stephan Bergmann1-8/+4
Change-Id: I6f32f7b1dcb97c9651bba2c03c495fb70448e524
2016-04-25Just don't bother with Clang <= 3.6Stephan Bergmann1-0/+2
...where Preprocessor::macros and Preprocessor::getLocalMacroDirectiveHistory would need to be done slightly differently Change-Id: Id46b05ac42012597c91a556b17ed008b6c7c5912
2016-04-22loplugin:reservedidStephan Bergmann1-0/+261
Change-Id: Ifa75d3f228db87f7a899612964bf08e9573fb5be
2016-04-22Avoid reserved identifiersStephan Bergmann1-1/+1
Change-Id: I263603fb81d368ebc8450b2d8cc01752fcd3f29d
2016-04-22Avoid reserved identifiersStephan Bergmann1-1/+1
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-04-21loplugin:salbool: sal_Bool[] -> bool[]Stephan Bergmann1-11/+78
Change-Id: I3c5bf7a53c9ae173f8fce885ecf022f092aa43a9
2016-04-21Use Sequence ctor taking initializer_listStephan Bergmann1-0/+39
needed adapting loplugin:implicitboolconversion to not warn about Sequence<sal_Bool> arBool({true, false, true}); Change-Id: I971918aab7c958ef8f1e4e0548a84314e95f8325