mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 23:35:27 +00:00
ofp-parse: Silence uninitialized use warnings with optimized gcc.
GCC 4.6.3 gets confused by the str_to_*() functions in ofp-parse and spits out the following warning. error: ‘priority’ may be used uninitialized in this function Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -132,7 +132,7 @@ str_to_u64(const char *str, uint64_t *valuep)
|
|||||||
static char * WARN_UNUSED_RESULT
|
static char * WARN_UNUSED_RESULT
|
||||||
str_to_be64(const char *str, ovs_be64 *valuep)
|
str_to_be64(const char *str, ovs_be64 *valuep)
|
||||||
{
|
{
|
||||||
uint64_t value;
|
uint64_t value = 0;
|
||||||
char *error;
|
char *error;
|
||||||
|
|
||||||
error = str_to_u64(str, &value);
|
error = str_to_u64(str, &value);
|
||||||
@@ -246,7 +246,7 @@ parse_resubmit(char *arg, struct ofpbuf *ofpacts)
|
|||||||
|
|
||||||
table_s = strsep(&arg, ",");
|
table_s = strsep(&arg, ",");
|
||||||
if (table_s && table_s[0]) {
|
if (table_s && table_s[0]) {
|
||||||
uint32_t table_id;
|
uint32_t table_id = 0;
|
||||||
char *error;
|
char *error;
|
||||||
|
|
||||||
error = str_to_u32(table_s, &table_id);
|
error = str_to_u32(table_s, &table_id);
|
||||||
@@ -598,10 +598,10 @@ parse_named_action(enum ofputil_action_code code,
|
|||||||
size_t orig_size = ofpacts->size;
|
size_t orig_size = ofpacts->size;
|
||||||
struct ofpact_tunnel *tunnel;
|
struct ofpact_tunnel *tunnel;
|
||||||
char *error = NULL;
|
char *error = NULL;
|
||||||
uint16_t ethertype;
|
uint16_t ethertype = 0;
|
||||||
uint16_t vid;
|
uint16_t vid = 0;
|
||||||
uint8_t pcp;
|
uint8_t tos = 0;
|
||||||
uint8_t tos;
|
uint8_t pcp = 0;
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case OFPUTIL_ACTION_INVALID:
|
case OFPUTIL_ACTION_INVALID:
|
||||||
@@ -1184,7 +1184,7 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string)
|
|||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
} else if (fields & F_PRIORITY && !strcmp(name, "priority")) {
|
} else if (fields & F_PRIORITY && !strcmp(name, "priority")) {
|
||||||
uint16_t priority;
|
uint16_t priority = 0;
|
||||||
|
|
||||||
error = str_to_u16(value, name, &priority);
|
error = str_to_u16(value, name, &priority);
|
||||||
fm->priority = priority;
|
fm->priority = priority;
|
||||||
|
Reference in New Issue
Block a user