diff mbox series

[ovs-dev] ofctrl: Placate GCC.

Message ID 20180731165758.17130-1-blp@ovn.org
State Accepted
Headers show
Series [ovs-dev] ofctrl: Placate GCC. | expand

Commit Message

Ben Pfaff July 31, 2018, 4:57 p.m. UTC
Some GCC versions don't like ".x.y =", complaining about an uninitialized
field.

Without this patch we get travis failures, e.g.
https://travis-ci.org/openvswitch/ovs/jobs/410404752:

    ovn/controller/ofctrl.c: In function ‘ofctrl_put’:
    ovn/controller/ofctrl.c:1086:9: error: missing initializer for field ‘flags’ of ‘struct ofputil_meter_config’ [-Werror=missing-field-initializers]
             };
             ^
    In file included from ovn/controller/ofctrl.c:35:0:
    ./include/openvswitch/ofp-meter.h:53:14: note: ‘flags’ declared here
         uint16_t flags;
                  ^

With it, it passes.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 ovn/controller/ofctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Justin Pettit July 31, 2018, 5:01 p.m. UTC | #1
> On Jul 31, 2018, at 9:57 AM, Ben Pfaff <blp@ovn.org> wrote:
> 
> Some GCC versions don't like ".x.y =", complaining about an uninitialized
> field.
> 
> Without this patch we get travis failures, e.g.
> https://travis-ci.org/openvswitch/ovs/jobs/410404752:
> 
>    ovn/controller/ofctrl.c: In function ‘ofctrl_put’:
>    ovn/controller/ofctrl.c:1086:9: error: missing initializer for field ‘flags’ of ‘struct ofputil_meter_config’ [-Werror=missing-field-initializers]
>             };
>             ^
>    In file included from ovn/controller/ofctrl.c:35:0:
>    ./include/openvswitch/ofp-meter.h:53:14: note: ‘flags’ declared here
>         uint16_t flags;
>                  ^
> 
> With it, it passes.
> 
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Justin Pettit <jpettit@ovn.org>

Thanks!

--Justin
Ben Pfaff July 31, 2018, 5:16 p.m. UTC | #2
On Tue, Jul 31, 2018 at 10:01:40AM -0700, Justin Pettit wrote:
> 
> > On Jul 31, 2018, at 9:57 AM, Ben Pfaff <blp@ovn.org> wrote:
> > 
> > Some GCC versions don't like ".x.y =", complaining about an uninitialized
> > field.
> > 
> > Without this patch we get travis failures, e.g.
> > https://travis-ci.org/openvswitch/ovs/jobs/410404752:
> > 
> >    ovn/controller/ofctrl.c: In function ‘ofctrl_put’:
> >    ovn/controller/ofctrl.c:1086:9: error: missing initializer for field ‘flags’ of ‘struct ofputil_meter_config’ [-Werror=missing-field-initializers]
> >             };
> >             ^
> >    In file included from ovn/controller/ofctrl.c:35:0:
> >    ./include/openvswitch/ofp-meter.h:53:14: note: ‘flags’ declared here
> >         uint16_t flags;
> >                  ^
> > 
> > With it, it passes.
> > 
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> 
> Acked-by: Justin Pettit <jpettit@ovn.org>

Thanks, applied.
diff mbox series

Patch

diff --git a/ovn/controller/ofctrl.c b/ovn/controller/ofctrl.c
index d2afd08129a2..96c57f143843 100644
--- a/ovn/controller/ofctrl.c
+++ b/ovn/controller/ofctrl.c
@@ -1082,7 +1082,7 @@  ofctrl_put(struct hmap *flow_table, struct shash *pending_ct_zones,
         /* Delete the meter. */
         struct ofputil_meter_mod mm = {
             .command = OFPMC13_DELETE,
-            .meter.meter_id = m_installed->table_id,
+            .meter = { .meter_id = m_installed->table_id },
         };
         add_meter_mod(&mm, &msgs);