The GCC with -fno-omit-frame-pointer -fno-common started to report
the following warning:

In function 'construct_dpdk_mutex_options',
    inlined from 'construct_dpdk_args' at lib/dpdk.c:238:5,
    inlined from 'dpdk_init__' at lib/dpdk.c:393:5,
    inlined from 'dpdk_init' at lib/dpdk.c:534:23:
lib/dpdk.c:220:13: error: 'found_value' may be used uninitialized 
[-Werror=maybe-uninitialized]
  220 |             svec_add(args, found_value);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/dpdk.c: In function 'dpdk_init':
lib/dpdk.c:189:21: note: 'found_value' was declared here
  189 |         const char *found_value;
      |                     ^~~~~~~~~~~
cc1: all warnings being treated as errors

Assign NULL to the variable to avoid this warning.

Signed-off-by: Ales Musil <[email protected]>
---
 lib/dpdk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dpdk.c b/lib/dpdk.c
index 077bdfc09..128098ec2 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -186,7 +186,7 @@ construct_dpdk_mutex_options(const struct smap 
*ovs_other_config,
     int i;
     for (i = 0; i < ARRAY_SIZE(excl_opts); ++i) {
         int found_opts = 0, scan, found_pos = -1;
-        const char *found_value;
+        const char *found_value = NULL;
         struct dpdk_exclusive_options_map *popt = &excl_opts[i];
 
         for (scan = 0; scan < MAX_DPDK_EXCL_OPTS
-- 
2.52.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to