[dpdk-dev] [PATCH v2] net/ionic: ignore missing field initializers warning
Thomas Monjalon
thomas at monjalon.net
Tue Jan 21 14:39:45 CET 2020
21/01/2020 11:01, Alfredo Cardigliano:
>
> > On 21 Jan 2020, at 10:58, Ferruh Yigit <ferruh.yigit at intel.com> wrote:
> >
> > The compiler warning is:
> > from .../drivers/net/ionic/ionic_dev.c:7:
> > .../drivers/net/ionic/ionic_if.h:202:5: note: ‘rsvd’ declared here
> > u8 rsvd[62];
> > ^
> >
> > This has been observed with gcc 4.8.5, newer 9+ compiler are not giving
> > this warning.
> >
> > Warning is a reminder to the user that there are some fields in the
> > struct not initialized with the default value.
> > But the C standard clarifies that in that case the field value will be
> > zero and code is aware of this behavior, so no initializing to a default
> > value is intentional and it is safe to ignore this compiler warning.
> >
> > Adding '-Wno-missing-field-initializers' compiler flag to disable the
> > warning.
> >
> > Reported-by: Anoob Joseph <anoobj at marvell.com>
> > Reported-by: Raslan Darawsheh <rasland at mellanox.com>
> > Reported-by: Xueming Zhang <xuemingx.zhang at intel.com>
> > Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
> > ---
> > v2:
> > * add flag to ionic_lif.c too
> > ---
> > drivers/net/ionic/Makefile | 3 +++
> > drivers/net/ionic/meson.build | 9 +++++++++
> > 2 files changed, 12 insertions(+)
[...]
> This looks good to me.
Applied, thanks
More information about the dev
mailing list