office-gobmx/compilerplugins/clang
Stephan Bergmann e63e769bd3 Introduce a better mechanism to suppress false loplugin warnings
...by annotating occurrences of false warnings with [-loplugin:<name>] comments
in source files and letting individual plugins opt-in to watch out for such
suppression annotations, rather than maintaining lists of excluded source files
in the individual plugins.  (See the new loplugin::Plugin::suppressWarningsAt.)

Instead of making all calls to loplugin::Plugin::report check for suppression
annotations, the intent is that this check will only be added opt-in to those
places in the plugins that are prone to emitting false warnings.  In general it
is better to have plugins that don't produce false warnings in the first place,
or at least let those warnings be addressed with trivial and harmless source
code modifications, avoiding the need for any suppression mechanism.

As a proof of concept, I have removed the exclude list from
loplugin:redundantfcast and instead annotated the relevant source code.  (And
thereby found that three of the six originally excluded files didn't need to be
excluded any more at all?)

For now, this mechanism looks for comments (both //... and /*...*/, even
documentation-style /**...*/) that overlap the current and/or the preceding
line, because at least for code controlled by clang-format it is often easier to
move comments to a line of their own, preceding the commented code.  Looking
also at the current line (and not only at the preceding one) opens the door for
erroneous over-eager annotation, where an annotation that was meant to address a
false warning on the current line would also silence a potentially true warning
on the following line.  This probably doesn't cause much trouble in practice,
but is up for potential change.

Change-Id: I91ce7a0e5248886a60b471b1a153867f16bb5cea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133365
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-25 18:21:24 +02:00
..
sharedvisitor
store
test new loplugin:stringviewvar looks for OUString vars that can be 2022-04-19 18:31:10 +02:00
automem.cxx
badstatics.cxx
blockblock.cxx
bufferadd.cxx
buriedassign.cxx
casttovoid.cxx -Werror,-Wunused-but-set-variable 2022-03-28 23:27:28 +02:00
changetoolsgen.cxx
charrightshift.cxx
check.cxx Simplify GlobalNamespace check 2022-04-05 14:40:07 +02:00
check.hxx
checkconfigmacros.cxx
checkunusedparams.cxx
classmemaccess.cxx
collapseif.cxx
colorcheck.cxx
commaoperator.cxx
comparisonwithconstant.cxx
compat.hxx
conditionalstring.cxx
constantparam.bitmask.results
constantparam.booleans.results
constantparam.constructors.results
constantparam.cxx loplugin:constantparam improvements 2022-03-24 08:39:48 +01:00
constantparam.numbers.results
constantparam.py
constfields.cxx
constfields.py
constfieldsrewrite.cxx
constmethod.cxx
constparams.cxx
conststringvar.cxx
consttobool.cxx
constvars.cxx
convertlong.cxx
countusersofdefaultparams.cxx
countusersofdefaultparams.py
cow_wrapper.cxx
cppunitassertequals.cxx
cstylecast.cxx
data.cxx
datamembershadow.cxx
dbgunhandledexception.cxx
derefnullptr.cxx
dllprivate.cxx
dodgyswitch.cxx
doubleconvert.cxx
duplicate-defines.cxx
dyncastvisibility.cxx
dynexcspec.cxx
elidestringvar.cxx
empty.cxx
emptyif.cxx
expandablemethods.cxx
expandablemethods.py
expressionalwayszero.cxx
external.cxx
externandnotdefined.cxx
faileddyncast.cxx
fakebool.cxx
finalclasses.cxx
finalclasses.py
flatten.cxx
fragiledestructor.cxx
functionaddress.hxx
getimplementationname.cxx
getstr.cxx
implicitboolconversion.cxx Introduce rtl::createUriCharClass 2022-04-15 08:39:21 +02:00
includeform.cxx Adapt to clang::PPCallbacks::InclusionDirective change in Clang 15 trunk 2022-04-15 21:05:03 +02:00
indentation.cxx Adapt loplugin:indentation to --enable-qt6 2022-03-22 14:15:52 +01:00
inlinefields.cxx
inlinefields.py
inlinesimplememberfunctions.cxx
inlinevisible.cxx
intvsfloat.cxx
literaltoboolconversion.cxx
logexceptionnicely.cxx
loopvartoosmall.cxx
makeshared.cxx
mapindex.cxx
memoryvar.cxx
mergeclasses.cxx
mergeclasses.py
mergeclasses.results Win/X11OpenGLDeviceInfo don't need a common base class 2022-03-22 11:41:54 +01:00
methodcycles.cxx
methodcycles.partition.results
methodcycles.py
methodcycles.results
moveparam.cxx
namespaceindentation.cxx
nestedunnamed.cxx
noexcept.cxx
noexceptmove.cxx
nullptr.cxx
oncevar.cxx
oslendian.cxx
overrideparam.cxx
overridevirtual.cxx
pahole-all-classes.py
passparamsbyref.cxx
passstuffbyref.cxx
plugin.cxx Introduce a better mechanism to suppress false loplugin warnings 2022-04-25 18:21:24 +02:00
plugin.hxx Introduce a better mechanism to suppress false loplugin warnings 2022-04-25 18:21:24 +02:00
pluginhandler.cxx
pluginhandler.hxx
pointerbool.cxx
precompiled_clang.hxx
privatebase.cxx
ptrvector.cxx
rangedforcopy.cxx
readability-redundant-pp.cxx
reducevarscope.cxx
redundantcast.cxx
redundantfcast.cxx Introduce a better mechanism to suppress false loplugin warnings 2022-04-25 18:21:24 +02:00
redundantinline.cxx
redundantpointerops.cxx
redundantstatic.cxx
refcounting.cxx
referencecasting.cxx
rendercontext.cxx
reservedid.cxx gtk4: add a surface_cell_renderer 2022-04-12 20:51:47 +02:00
returnconstant.cxx
returnconstval.cxx
salcall.cxx
sallogareas.cxx
salunicodeliteral.cxx
selfinit.cxx
sequentialassign.cxx
sfxpoolitem.cxx
shouldreturnbool.cxx
simplifyconstruct.cxx
simplifydynamiccast.cxx
simplifypointertobool.cxx
singlevalfields.could-be-bool.results
singlevalfields.cxx Adapt loplugin:singlevalfields to AtomicExpr 2022-03-28 10:23:20 +02:00
singlevalfields.py
singlevalfields.results
staticaccess.cxx
staticconstfield.cxx
staticdynamic.cxx
staticmethods.cxx
staticvar.cxx
stdfunction.cxx
stringadd.cxx
stringconcatauto.cxx
stringconcatliterals.cxx
stringconstant.cxx
stringliteraldefine.cxx
stringliteralvar.cxx
stringloop.cxx
stringstatic.cxx
stringview.cxx loplugin:stringview more o3tl conversion 2022-04-12 12:42:15 +02:00
stringviewparam.cxx loplugin:stringviewparam convert methods using copy() 2022-04-17 10:27:33 +02:00
stringviewvar.cxx loplugin:stringviewvar disable for now 2022-04-20 12:59:42 +02:00
subtlezeroinit.cxx
toolslong.cxx
trivialconstructor.cxx Consistently avoid loplugin:trivialconstructor when there are defaulted params 2022-03-16 21:10:27 +01:00
trivialdestructor.cxx Simplify loplugin:trivialdestructor 2022-03-15 14:41:28 +01:00
typedefparam.cxx
typeidcomparison.cxx
unicodetochar.cxx
unnecessarycatchthrow.cxx
unnecessaryoverride.cxx
unnecessaryparen.cxx
unnecessaryvirtual-dead.results
unnecessaryvirtual.cxx loplugins ignoreLocation() is unreliable with PCH 2022-03-25 14:35:24 +01:00
unnecessaryvirtual.py
unnecessaryvirtual.results
unoany.cxx
unoquery.cxx
unreffun.cxx
unsignedcompare.cxx
unusedcapturedefault.cxx
unusedenumconstants.cxx
unusedenumconstants.py
unusedenumconstants.readonly.results
unusedenumconstants.untouched.results
unusedenumconstants.writeonly.results
unusedfields.cxx
unusedfields.only-used-in-constructor.results loplugin:unusedfields 2022-03-23 10:18:54 +01:00
unusedfields.py
unusedfields.readonly.results loplugin:unusedfields 2022-03-23 10:18:54 +01:00
unusedfields.untouched.results loplugin:unusedfields 2022-03-23 10:18:54 +01:00
unusedfields.writeonly.results loplugin:unusedfields 2022-03-23 10:18:54 +01:00
unusedfieldsremove.cxx
unusedindex.cxx
unusedmember.cxx
unusedmethods.cxx
unusedmethods.py
unusedmethods.results
unusedmethods.unused-returns.results
unusedmethodsremove.cxx
unusedvariablecheck.cxx
unusedvariablecheck.hxx
unusedvariablemore.cxx
unusedvariableplus.cxx
unusedvarsglobal.cxx
unusedvarsglobal.py
unusedvarsglobal.untouched.results
unusedvarsglobal.writeonly.results
useuniqueptr.cxx
vclwidgets.cxx
virtualdead.cxx loplugins ignoreLocation() is unreliable with PCH 2022-03-25 14:35:24 +01:00
virtualdead.py
virtualdead.results
virtualdead.unusedparams.results
virtualdown.cxx
virtualdown.py
virtualdown.results
weakbase.cxx
weakobject.cxx
writeonlyvars.cxx
xmlimport.cxx