On 04/26/2018 12:08 AM, John Fastabend wrote: > Here the variable cont is used as the saved_pointer for a call to > strtok_r(). It is safe to use the value uninitialized in this > context however and the later reference is only ever used if > the strtok_r is successful. But, 'gcc-5' at least doesn't have all > this knowledge so initialize cont to NULL. Additionally, do the > natural NULL check before accessing just for completness. > > The warning is the following: > > ./bpf/tools/bpf/bpf_dbg.c: In function ‘cmd_load’: > ./bpf/tools/bpf/bpf_dbg.c:1077:13: warning: ‘cont’ may be used uninitialized > in this function [-Wmaybe-uninitialized] > } else if (matches(subcmd, "pcap") == 0) { > > Fixes: fd981e3c321a "filter: bpf_dbg: add minimal bpf debugger" > Signed-off-by: John Fastabend <john.fastab...@gmail.com>
Applied to bpf tree, thanks John!