On 22/01/2026 06:59, Ales Musil wrote:
> On Wed, Jan 21, 2026 at 6:33 PM Kevin Traynor <[email protected]> wrote:
> 
>> On 14/01/2026 11:25, Ales Musil via dev wrote:
>>> 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.
>>>
>>
>> Hi Ales,
>>
> 
> Hi Kevin,
> 
> 
>>
>> The patch looks fine. The warning seems to be a false positive as it
>> would have a value for found_value or continued.
>>
> 
> Yes the warning is a false positive.
> 
> 
>>
>> I couldn't reproduce this with GCC 15 or 16, which version of GCC were
>> you using and did you have any other flags set ?
>>
> 
> # gcc --version
> gcc (GCC) 15.2.1 20251211 (Red Hat 15.2.1-5)
> 
> And the flags used:
> ./configure 'CFLAGS= -O1 -fno-omit-frame-pointer -fno-common -g'
> --with-dpdk=static --enable-Werror --enable-sparse
> 

Ah ok, it needs the -O1, it doesn't show up at other optimization
levels. Maybe we should mention that in the commit message. I can add it
on apply if it's fine for you.

thanks,
Kevin.

> 
>>
>> thanks,
>> Kevin.
>>
> 
> Regards,
> Ales
> 
> 
>>
>>> 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
>>
>>
> 

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

Reply via email to