[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230523050604.h7qlqdop2fxxcejy@lion.mk-sys.cz>
Date: Tue, 23 May 2023 07:06:04 +0200
From: Michal Kubecek <mkubecek@...e.cz>
To: Dario Binacchi <dario.binacchi@...rulasolutions.com>
Cc: netdev@...r.kernel.org,
Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>
Subject: Re: [PATCH ethtool v2, 1/1] netlink/rss: move variable declaration
out of the for loop
On Mon, May 22, 2023 at 07:54:01PM +0200, Dario Binacchi wrote:
> The patch fixes this compilation error:
>
> netlink/rss.c: In function 'rss_reply_cb':
> netlink/rss.c:166:3: error: 'for' loop initial declarations are only allowed in C99 mode
> for (unsigned int i = 0; i < get_count(hash_funcs); i++) {
> ^
> netlink/rss.c:166:3: note: use option -std=c99 or -std=gnu99 to compile your code
>
> The project doesn't really need a C99 compiler, so let's move the variable
> declaration outside the for loop.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@...rulasolutions.com>
> ---
To be honest, I'm rather surprised that this would be the only C99
feature in ethtool code, I thought that e.g. the named struct
initializers also require C99.
Anyway, with kernel explicitly declaring C11 as the standard to use
since 5.18, it would IMHO make more sense to do the same in ethtool so
that developers do not need to keep in mind that they cannot use
language features they are used to from kernel. What do you think?
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists