DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: mlx5:  unitialized warning
Date: Fri, 17 Dec 2021 19:01:31 +0000	[thread overview]
Message-ID: <MN2PR12MB3087F008F6AA42139934EE4FB9789@MN2PR12MB3087.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20211217100551.0de71855@hermes.local>

> Building current main branch with gcc (Debian 10.2.1-6) 10.2.1 20210110
> 
> 
> [1843/3131] Compiling C object
> drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_flow_meter.c.o
> ../drivers/net/mlx5/mlx5_flow_meter.c: In function
> ‘mlx5_flow_meter_create’:
> ../drivers/net/mlx5/mlx5_flow_meter.c:1170:33: warning: ‘legacy_fm’ may be
> used uninitialized in this function [-Wmaybe-uninitialized]
>  1170 |  struct mlx5_legacy_flow_meter *legacy_fm;
>       |                                 ^~~~~~~~~

Hi Stephen,

I don't see this warning with gcc 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04).
Firstly, I believe it's a false positive:
legacy_fm is initialized and used only when priv->sh->meter_aso_en == false:

1237	if (priv->sh->meter_aso_en) {
		...
1245	} else {
    		legacy_fm = ...
		if (legacy_fm == NULL)
			return ...;
		...
	}
	...
1276	if (!priv->sh->meter_aso_en)
		TAILQ_INSERT_TAIL(fms, legacy_fm, next);

However, even if it's fixed in GCC between 10.2.1 and 10.3.0,
I've seen it with x86_64-w64-mingw32-gcc (GCC) 9.3-win32 20200320
while working on enabling drivers/*/mlx5 build with GCC,
so a workaround will probably still be needed.

  reply	other threads:[~2021-12-17 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 18:05 Stephen Hemminger
2021-12-17 19:01 ` Dmitry Kozlyuk [this message]
2021-12-17 19:19   ` Stephen Hemminger
2021-12-17 19:28     ` Dmitry Kozlyuk
2021-12-17 20:17       ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR12MB3087F008F6AA42139934EE4FB9789@MN2PR12MB3087.namprd12.prod.outlook.com \
    --to=dkozlyuk@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).