Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/ethtool: fix build failure
Date: Sun, 21 May 2023 17:23:20 +0200	[thread overview]
Message-ID: <20230521152320.GD171618@scaer> (raw)
In-Reply-To: <20230520211246.3950131-1-dario.binacchi@amarulasolutions.com>

Dario, All,

On 2023-05-20 23:12 +0200, Dario Binacchi spake thusly:
> When I was fixing a build failure for the libmnl package ([1]), I got
> this error for the ethtool compilation:
> 
> 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
> 
> [1] http://autobuild.buildroot.net/results/15f6dc103eec7bdeb5020acbc0ae99dc97c00e4e
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  package/ethtool/ethtool.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/ethtool/ethtool.mk b/package/ethtool/ethtool.mk
> index a35e274bc442..c72d59be3767 100644
> --- a/package/ethtool/ethtool.mk
> +++ b/package/ethtool/ethtool.mk
> @@ -20,4 +20,6 @@ else
>  ETHTOOL_CONF_OPTS += --disable-netlink
>  endif
>  
> +ETHTOOL_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99"

The proper solution is to add AC_PROG_CC_C99 to configure.ac, and check
that ac_cv_prog_cc_c99 is not set to 'no':

    https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/C-Compiler.html#index-AC_005fPROG_005fCC_005fC99-866

(and then needs AUTORECONF=YES)

Alternatively, if upstream does not really need a C99 compiler, maybe
move the variable declaration out of the for-loop.

Regards,
Yann E. MORIN.

>  $(eval $(autotools-package))
> -- 
> 2.32.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2023-05-21 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20 21:12 [Buildroot] [PATCH 1/1] package/ethtool: fix build failure Dario Binacchi
2023-05-21 15:23 ` Yann E. MORIN [this message]

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=20230521152320.GD171618@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=dario.binacchi@amarulasolutions.com \
    /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