mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
db-ctl-base: Fix compilation warnings.
This commit fixes uninitialized variable warnings in functions
cmd_create() and cmd_get() when compiling with gcc 6.3.1 and -Werror
by initializing variables 'symbol' and 'new' to NULL.
Cc: Alex Wang <alexw@nicira.com>
Fixes: 07ff77ccb8
("db-ctl-base: Make common database command code into library.")
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -919,8 +919,8 @@ cmd_get(struct ctl_context *ctx)
|
||||
}
|
||||
|
||||
if (id) {
|
||||
struct ovsdb_symbol *symbol;
|
||||
bool new;
|
||||
struct ovsdb_symbol *symbol = NULL;
|
||||
bool new = NULL;
|
||||
|
||||
ctx->error = create_symbol(ctx->symtab, id, &symbol, &new);
|
||||
if (ctx->error) {
|
||||
@@ -1698,7 +1698,7 @@ cmd_create(struct ctl_context *ctx)
|
||||
const char *table_name = ctx->argv[1];
|
||||
const struct ovsdb_idl_table_class *table;
|
||||
const struct ovsdb_idl_row *row;
|
||||
const struct uuid *uuid;
|
||||
const struct uuid *uuid = NULL;
|
||||
int i;
|
||||
|
||||
ctx->error = get_table(table_name, &table);
|
||||
@@ -1706,7 +1706,7 @@ cmd_create(struct ctl_context *ctx)
|
||||
return;
|
||||
}
|
||||
if (id) {
|
||||
struct ovsdb_symbol *symbol;
|
||||
struct ovsdb_symbol *symbol = NULL;
|
||||
|
||||
ctx->error = create_symbol(ctx->symtab, id, &symbol, NULL);
|
||||
if (ctx->error) {
|
||||
@@ -1719,8 +1719,6 @@ cmd_create(struct ctl_context *ctx)
|
||||
symbol->strong_ref = true;
|
||||
}
|
||||
uuid = &symbol->uuid;
|
||||
} else {
|
||||
uuid = NULL;
|
||||
}
|
||||
|
||||
row = ovsdb_idl_txn_insert(ctx->txn, table, uuid);
|
||||
|
Reference in New Issue
Block a user