Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Petr Machata <petrm@nvidia.com>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	Tariq Toukan <tariqt@nvidia.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH iproute2-next] ip: Convert non-constant initializers to macros
Date: Tue, 31 May 2022 17:12:32 +0300	[thread overview]
Message-ID: <YpYiUJlmp0X5jH0S@shredder> (raw)
In-Reply-To: <7feecdf0b0354cd31de7f716e10ed122066ba061.1653996204.git.petrm@nvidia.com>

On Tue, May 31, 2022 at 01:35:48PM +0200, Petr Machata wrote:
> As per the C standard, "expressions in an initializer for an object that
> has static or thread storage duration shall be constant expressions".
> Aggregate objects are not constant expressions. Newer GCC doesn't mind, but
> older GCC and LLVM do.
> 
> Therefore convert to a macro. And since all these macros will look very
> similar, extract a generic helper, IPSTATS_STAT_DESC_XSTATS_LEAF, which
> takes the leaf name as an argument and initializes the rest as appropriate
> for an xstats descriptor.
> 
> Reported-by: Stephen Hemminger <stephen@networkplumber.org>
> Signed-off-by: Petr Machata <petrm@nvidia.com>

Patch is directed at iproute2-next, but code is already in main branch

Fixes: d9976d671c37 ("ipstats: Expose bond stats in ipstats")
Fixes: 36e10429dafc ("ipstats: Expose bridge stats in ipstats")
Reviewed-by: Ido Schimmel <idosch@nvidia.com>

Fixes the build issue with clang on my laptop

      reply	other threads:[~2022-05-31 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 11:35 [PATCH iproute2-next] ip: Convert non-constant initializers to macros Petr Machata
2022-05-31 14:12 ` Ido Schimmel [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=YpYiUJlmp0X5jH0S@shredder \
    --to=idosch@nvidia.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=stephen@networkplumber.org \
    --cc=tariqt@nvidia.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