From: Sunil Dora <[email protected]>

clang 23's lifetime analysis flags the framework's
postprocessing_computepass.cpp taking .begin() of a temporary, and the
project builds with -Werror:

  framework/rendering/postprocessing_computepass.cpp:154:33: error:
  object backing the pointer will be destroyed at the end of the
  full-expression [-Werror,-Wdangling-gsl]

The warning is a true positive: get_resources() returns a vector by
value, so the code compares iterators from two different temporaries
and later dereferences a dangling one. The affected class is unused
(Vulkan-Samples issue #841) but still compiled everywhere. Reported
upstream with analysis and a proposed fix:
https://github.com/KhronosGroup/Vulkan-Samples/issues/1570

Fixing the framework source is upstream's call; from the recipe, extend
the existing clang workaround flags to keep the warning non-fatal.

Signed-off-by: Sunil Dora <[email protected]>
---
 meta/recipes-graphics/vulkan/vulkan-samples_git.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb 
b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb
index 75d7a39eb6..3d965ff22e 100644
--- a/meta/recipes-graphics/vulkan/vulkan-samples_git.bb
+++ b/meta/recipes-graphics/vulkan/vulkan-samples_git.bb
@@ -31,6 +31,8 @@ EXTRA_OECMAKE += "-DVKB_WSI_SELECTION=D2D"
 
 # Clang is fussy about incompatible options on aarch64/x86_64
 # x86_64-poky-linux-clang++: error: overriding '-ffp-model=precise' option 
with '-ffp-contract=fast' [-Werror,-Woverriding-option]
-CXXFLAGS:append:toolchain-clang = " -Wno-error=overriding-option"
+# clang 23's -Wdangling-gsl also flags framework code taking .begin() of a
+# temporary (postprocessing_computepass.cpp); keep it a warning, not an error.
+CXXFLAGS:append:toolchain-clang = " -Wno-error=overriding-option 
-Wno-error=dangling-gsl"
 
 COMPATIBLE_HOST = "(aarch64|x86_64).*-linux"
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#244651): 
https://lists.openembedded.org/g/openembedded-core/message/244651
Mute This Topic: https://lists.openembedded.org/mt/120998131/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to