[Build] fix build warning
authorJaeyun <jy1210.jung@samsung.com>
Tue, 5 Oct 2021 03:04:42 +0000 (12:04 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 6 Oct 2021 23:20:33 +0000 (08:20 +0900)
Fix build warning (missing-braces, uninitialized).

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_nnfw.c
gst/nnstreamer/tensor_filter/tensor_filter_common.h
gst/nnstreamer/tensor_filter/tensor_filter_single.c
meson.build

index 3e0d4c7..a930917 100644 (file)
@@ -555,8 +555,8 @@ nnfw_invoke_dummy (const nnfw_pdata * pdata, const nnfw_tinfo_s * in_info,
     const nnfw_tinfo_s * out_info)
 {
   GstTensorsInfo gst_in_info, gst_out_info;
-  GstTensorMemory input[NNS_TENSOR_SIZE_LIMIT] = { 0, };
-  GstTensorMemory output[NNS_TENSOR_SIZE_LIMIT] = { 0, };
+  GstTensorMemory input[NNS_TENSOR_SIZE_LIMIT] = { {0} };
+  GstTensorMemory output[NNS_TENSOR_SIZE_LIMIT] = { {0} };
   gboolean failed = FALSE;
   guint i, retry;
   int err;
index d767438..149fb49 100644 (file)
@@ -64,12 +64,11 @@ G_BEGIN_DECLS
     } while (0)
 
 #define GST_TF_FW_INVOKE_COMPAT(priv,ret,in,out) do { \
+      ret = -1; \
       if (GST_TF_FW_V0 ((priv)->fw)) { \
         ret = (priv)->fw->invoke_NN (&(priv)->prop, &(priv)->privateData, (in), (out)); \
       } else if (GST_TF_FW_V1 ((priv)->fw)) { \
         ret = (priv)->fw->invoke ((priv)->fw, &(priv)->prop, (priv)->privateData, (in), (out)); \
-      } else { \
-        g_assert(FALSE); \
       } \
     } while (0)
 
index 2b5779e..a4f2c01 100644 (file)
@@ -323,7 +323,7 @@ g_tensor_filter_single_invoke (GTensorFilterSingle * self,
   GTensorFilterSinglePrivate *spriv;
   GstTensorFilterPrivate *priv;
   GstTensorMemory *_out;
-  GstTensorMemory out_tensors[NNS_TENSOR_SIZE_LIMIT] = { 0, };
+  GstTensorMemory out_tensors[NNS_TENSOR_SIZE_LIMIT] = { {0} };
   guint i;
   gint status;
 
index 83ff601..fca7238 100644 (file)
@@ -44,6 +44,8 @@ endif
 
 # Define warning flags for c and cpp
 warning_flags = [
+  '-Wmissing-braces',
+  '-Wmaybe-uninitialized',
   '-Wwrite-strings',
   '-Wformat',
   '-Wformat-nonliteral',