[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210824104323.12dce041@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 24 Aug 2021 10:43:23 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: andrew@...n.ch, netdev@...r.kernel.org, dcavalca@...com,
filbranden@...com, michel@...com
Subject: Re: [PATCH ethtool 2/3] ethtool: use dummy args[] entry for no-args
case
On Tue, 24 Aug 2021 19:41:23 +0200 Michal Kubecek wrote:
> On Fri, Aug 13, 2021 at 10:19:37AM -0700, Jakub Kicinski wrote:
> > Note that this patch adds a false-positive warning with GCC 11:
> >
> > ethtool.c: In function ‘find_option’:
> > ethtool.c:6082:29: warning: offset ‘1’ outside bounds of constant string [-Warray-bounds]
> > 6082 | opt += len + 1;
> > | ~~~~^~~~~~~~~~
> >
> > we'll never get to that code if the string is empty.
>
> Unless I missed something, an easy workaround should be starting the
> loop in find_option() from 1 rather than from 0. It would IMHO even make
> more sense as there is little point comparing the first argument against
> the dummy args[0] entry.
SGTM, will you commit a patch or should I send one?
Powered by blists - more mailing lists