lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABGWkvrG8rsWpLaXhLN6G0GqW3XF1z=fy=GaCs34iti6+r2TPg@mail.gmail.com>
Date: Tue, 23 May 2023 09:28:19 +0200
From: Dario Binacchi <dario.binacchi@...rulasolutions.com>
To: Michal Kubecek <mkubecek@...e.cz>
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

Hi Michal,

On Tue, May 23, 2023 at 7:06 AM Michal Kubecek <mkubecek@...e.cz> wrote:
>
> 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.

Yes, you're probably right. That might be the first of the compilation errors,
or in other cases, the compiler I used may only display warnings.

>
> 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?

I agree with you.
Anyway, to fix this issue
https://patchwork.ozlabs.org/project/buildroot/patch/20230520211246.3950131-1-dario.binacchi@amarulasolutions.com/
can I send patch updating configure.ac as suggested by Yann E. Morin ?

--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,10 @@ AC_PROG_CC
 AC_PROG_GCC_TRADITIONAL
 AM_PROG_CC_C_O
 PKG_PROG_PKG_CONFIG
+AC_PROG_CC_C99
+AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
+       AC_MSG_ERROR([no C99 compiler found, $PACKAGE requires a C99 compiler.])
+])

Thanks and regards,
Dario

>
> Michal


-- 

Dario Binacchi

Senior Embedded Linux Developer

dario.binacchi@...rulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@...rulasolutions.com

www.amarulasolutions.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ