File nnstreamer-3580.patch of Package nnstreamer

From 927e8c3cc0955bd70f21781a43a0efcd0484e8b4 Mon Sep 17 00:00:00 2001
From: Julien Vuillaumier <julien.vuillaumier@nxp.com>
Date: Wed, 3 Nov 2021 15:19:04 +0100
Subject: [PATCH 1/2] [Test] Fix build issue with GCC 11
 [-Werror=maybe-uninitialized]

Correction for build issue showing up with GCC 11

unittest_common.cc:953:51:
error: 'structure' may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
---
 tests/common/unittest_common.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/common/unittest_common.cc b/tests/common/unittest_common.cc
index 7270ad10c..1d8a3327d 100644
--- a/tests/common/unittest_common.cc
+++ b/tests/common/unittest_common.cc
@@ -948,7 +948,7 @@ TEST (commonTensorsConfig, validateInvalidParam2_n)
  */
 TEST (commonTensorsConfig, fromStructreInvalidParam0_n)
 {
-  GstStructure structure;
+  GstStructure structure = { 0 };
 
   EXPECT_FALSE (gst_tensors_config_from_structure (NULL, &structure));
 }

From f7840416e13a8f6a863752af578c182957aba5b0 Mon Sep 17 00:00:00 2001
From: MyungJoo Ham <myungjoo.ham@samsung.com>
Date: Wed, 27 Oct 2021 23:04:49 +0900
Subject: [PATCH 2/2] tensor-filter-common: unnecessary usage of volatile

GLib-Once (g_once_init_enter/leave) have already taken
care of concurrency.
Its users do not need to worry about cache coherency or
concurrency issues for the initialization.

Actually, as #3440 is showing, the volatile keyword
is neglected by g_once_init_enter function, making
the usage of volatile meaningless anyway.

Remove volatile keyword and mitigate the first
compiler warning-error of #3440

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
---
 gst/nnstreamer/tensor_filter/tensor_filter_common.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_common.c b/gst/nnstreamer/tensor_filter/tensor_filter_common.c
index 74f5bbe4e..9f08c4472 100644
--- a/gst/nnstreamer/tensor_filter/tensor_filter_common.c
+++ b/gst/nnstreamer/tensor_filter/tensor_filter_common.c
@@ -2762,9 +2762,9 @@ parse_accl_hw_fill (parse_accl_args accl_args)
 static GType
 accl_hw_get_type (void)
 {
-  static volatile gsize g_accl_hw_type_id__volatile = 0;
+  static gsize g_accl_hw_type_id_store = 0;
 
-  if (g_once_init_enter (&g_accl_hw_type_id__volatile)) {
+  if (g_once_init_enter (&g_accl_hw_type_id_store)) {
     static const GEnumValue values[] = {
       {ACCL_NONE, ACCL_NONE_STR, ACCL_NONE_STR},
       {ACCL_DEFAULT, ACCL_DEFAULT_STR, ACCL_DEFAULT_STR},
@@ -2788,10 +2788,10 @@ accl_hw_get_type (void)
 
     GType g_accl_hw_type_id =
         g_enum_register_static (g_intern_static_string ("accl_hw"), values);
-    g_once_init_leave (&g_accl_hw_type_id__volatile, g_accl_hw_type_id);
+    g_once_init_leave (&g_accl_hw_type_id_store, g_accl_hw_type_id);
   }
 
-  return g_accl_hw_type_id__volatile;
+  return g_accl_hw_type_id_store;
 }
 
 /**
openSUSE Build Service is sponsored by