netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Quartulli <a@unstable.cc>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, cake@lists.bufferbloat.net, toke@toke.dk,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
	stephen@networkplumber.org
Subject: Re: [PATCH] net/sch_generic.h: use sizeof_member() and get rid of unused variable
Date: Wed, 20 May 2020 23:25:38 +0200	[thread overview]
Message-ID: <6759d98f-03fd-672c-e1eb-22ccc37e2b5d@unstable.cc> (raw)
In-Reply-To: <20200520.111717.835995575109387492.davem@davemloft.net>

On 20/05/2020 20:17, David Miller wrote:
> From: Antonio Quartulli <a@unstable.cc>
> Date: Wed, 20 May 2020 10:39:33 +0200
> 
>> I don't think it's BUILD_BUG_ON()'s fault, because qcb->data is passed
>> to sizeof() first.
>>
>> My best guess is that gcc is somewhat optimizing the sizeof(gcb->data)
>> and thus leaving the gcb variable unused.
> 
> If you remove the argument from the function but leave the BUILD_BUG_ON()
> calls the same, the compilation will fail.
> 
> Any such optimization is therefore unreasonable.
> 
> The variable is used otherwise compilation would not fail when you
> remove it right?

You're correct.
I guess this should be reported to gcc then.


Regards,

-- 
Antonio Quartulli

      reply	other threads:[~2020-05-20 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  9:13 [PATCH] net/sch_generic.h: use sizeof_member() and get rid of unused variable Antonio Quartulli
2020-05-19 22:40 ` David Miller
2020-05-20  8:39   ` Antonio Quartulli
2020-05-20 18:17     ` David Miller
2020-05-20 21:25       ` Antonio Quartulli [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=6759d98f-03fd-672c-e1eb-22ccc37e2b5d@unstable.cc \
    --to=a@unstable.cc \
    --cc=cake@lists.bufferbloat.net \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=toke@toke.dk \
    --cc=xiyou.wangcong@gmail.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;
as well as URLs for NNTP newsgroup(s).