All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ananyev, Konstantin" <konstantin.ananyev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "Wodkowski,
	PawelX"
	<pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Thomas Monjalon
	<thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Cc: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: error: value computed is not used
Date: Mon, 15 Dec 2014 16:35:24 +0000	[thread overview]
Message-ID: <2601191342CEEE43887BDE71AB977258213C0DBE@IRSMSX105.ger.corp.intel.com> (raw)
In-Reply-To: <F6F2A6264E145F47A18AB6DF8E87425D12B79FC6-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>



> -----Original Message-----
> From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Wodkowski, PawelX
> Sent: Monday, December 15, 2014 3:44 PM
> To: Thomas Monjalon
> Cc: dev-VfR2kkLFssw@public.gmane.org
> Subject: Re: [dpdk-dev] error: value computed is not used
> 
> > > > > And something like this?
> > > > >
> > > > >  #define rte_memcpy(dst, src, n)              \
> > > > > -	((__builtin_constant_p(n)) ?          \
> > > > > +	({ (__builtin_constant_p(n)) ?          \
> > > > >  	memcpy((dst), (src), (n)) :          \
> > > > > -	rte_memcpy_func((dst), (src), (n)))
> > > > > +	rte_memcpy_func((dst), (src), (n)); })
> > > >
> > > > What happens to the returned value after this change?
> > > > ptr = rte_memcpy(dst, src, n) + offset:
> > > >
> > > https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html#Statement-Exprs
> > >
> > > Whole expression should be 'void *' type (like *memcpy()) and it should work
> > > as usual (see maxint() example in above link). It is GCC extension.
> >
> > OK nice.
> > I didn't test it on SUSE 11 SP3. I assume you did it?
> I did not tested this, as this was only proposal. I only run build process and it pass.
> Patch proposal will be sent in a while.
> 
> > Please Pawel, could you send a proper patch quickly?
> > If nobody disagree, it'll be merged in RC5 today.
> >
> > > > > Thomas, can you check build with EXTRA_CFLAG='-Wunused-value'.
> > > >
> > > > You mean EXTRA_CFLAGS (with a S).
> > > > It fails in many locations.
> > > > What's your point?
> > >
> > > I am just asking if this is an typo, error or intend to do statements with no
> > effects like bellow.
> > >
> > > ixgbe_common.c:4429:3: error: statement with no effect [-Werror=unused-
> > value]
> > >
> > > 4426:	/* first pull in the header so we know the buffer length */
> > > 4427:	for (bi = 0; bi < dword_len; bi++) {
> > > 4428:		buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
> > bi);
> > > 4429:		IXGBE_LE32_TO_CPUS(&buffer[bi]); // <------ here
> > > 4430	}
> >
> > It's an intent. On big endian CPU, this has an effect.
> >
> 
> If you see something what I am not, please ignore this part but for me this looks like it should be:
> tmp = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
> buffer[bi] = IXGBE_LE32_TO_CPUS (tmp);

Yep, same thought here, see my other mail on that subject.
Konstantin

> 
> Pawel

  parent reply	other threads:[~2014-12-15 16:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08  9:05 error: value computed is not used Qiu, Michael
     [not found] ` <533710CFB86FA344BFBF2D6802E60286C9D989-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-08 11:00   ` Wodkowski, PawelX
2014-12-08 15:23     ` Qiu, Michael
     [not found]       ` <533710CFB86FA344BFBF2D6802E60286C9DB8B-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-08 15:26         ` Wodkowski, PawelX
     [not found]           ` <F6F2A6264E145F47A18AB6DF8E87425D12B67782-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 10:54             ` Thomas Monjalon
2014-12-15 11:07               ` [PATCH] enic: fix build on SUSE 11 Thomas Monjalon
2014-12-15 11:27               ` error: value computed is not used Wodkowski, PawelX
     [not found]                 ` <F6F2A6264E145F47A18AB6DF8E87425D12B79ECF-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 13:26                   ` Thomas Monjalon
2014-12-15 13:47                     ` Wodkowski, PawelX
     [not found]                       ` <F6F2A6264E145F47A18AB6DF8E87425D12B79F59-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 14:16                         ` Thomas Monjalon
2014-12-15 15:44                           ` Wodkowski, PawelX
     [not found]                             ` <F6F2A6264E145F47A18AB6DF8E87425D12B79FC6-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 16:35                               ` Ananyev, Konstantin [this message]
2014-12-15 16:00                           ` Ananyev, Konstantin
     [not found]                             ` <2601191342CEEE43887BDE71AB977258213C0D6A-kPTMFJFq+rEu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 16:40                               ` Thomas Monjalon
2014-12-15 17:03                           ` Jastrzebski, MichalX K
2014-12-16  0:49               ` Qiu, Michael
2014-12-09  9:19 ` Qiu, Michael
2014-12-10  9:26 ` Qiu, Michael

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=2601191342CEEE43887BDE71AB977258213C0DBE@IRSMSX105.ger.corp.intel.com \
    --to=konstantin.ananyev-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    --cc=pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.