This patch fixes the following build failures seen on Ubuntu 16.04
with gcc 5.4.0 because of uninitialized variables:
...
examples/pipeline/cli.c:1559:11: error: 'weight_val' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:1545:13: error: 'member_id_val' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:1538:12: error: 'group_id_val' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:2189:2: error: 'idx1' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:2179:43: error: 'idx0' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:2265:2: error: 'idx1' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:2248:43: error: 'idx0' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:2358:2: error: 'idx1' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
...
examples/pipeline/cli.c:2325:43: error: 'idx0' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
Fixes:
598fe0dd0d8e ("examples/pipeline: support selector table")
Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
{
char *token_array[GROUP_MEMBER_INFO_TOKENS_MAX], **tokens;
char *s0 = NULL, *s;
- uint32_t n_tokens = 0, group_id_val, member_id_val, weight_val;
+ uint32_t n_tokens = 0, group_id_val = 0, member_id_val = 0, weight_val = 0;
int blank_or_comment = 0;
/* Check input arguments. */
{
struct pipeline *p;
const char *name;
- uint32_t idx0, idx1;
+ uint32_t idx0 = 0, idx1 = 0;
if (n_tokens != 9) {
snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
{
struct pipeline *p;
const char *name, *profile_name;
- uint32_t idx0, idx1;
+ uint32_t idx0 = 0, idx1 = 0;
if (n_tokens != 11) {
snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
struct rte_swx_ctl_meter_stats stats;
struct pipeline *p;
const char *name;
- uint32_t idx0, idx1;
+ uint32_t idx0 = 0, idx1 = 0;
if (n_tokens != 9) {
snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);