Avoid a false loplugin:casttovoid on macOS

...involving conditional preprocessed code at

> vcl/skia/SkiaHelper.cxx:265:13: error: unnecessary cast to void [loplugin:casttovoid]
>   265 |             (void)blockDisable;
>       |             ^~~~~~~~~~~~~~~~~~
> vcl/skia/SkiaHelper.cxx:286:22: note: first consumption is here [loplugin:casttovoid]
>   286 |                 if (!blockDisable && !DefaultMTLDeviceIsSupported())
>       |                      ^~~~~~~~~~~~

Change-Id: I222d72d240852be2d64fe08d345f00d137cd5a63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157707
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2023-10-09 22:33:02 +02:00
parent ba12432032
commit 969990becc
+5
View File
@@ -425,6 +425,11 @@ private:
}
}
} else {
if (auto const fun = dyn_cast_or_null<FunctionDecl>(i.first->getDeclContext())) {
if (containsPreprocessingConditionalInclusion(fun->getSourceRange())) {
continue;
}
}
for (auto const j: i.second.castToVoid) {
report(
DiagnosticsEngine::Warning, "unnecessary cast to void",