DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] error: value computed is not used
@ 2014-12-08  9:05 Qiu, Michael
  2014-12-08 11:00 ` Wodkowski, PawelX
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Qiu, Michael @ 2014-12-08  9:05 UTC (permalink / raw)
  To: dev

Hi all,
My platform is:

uname -a
Linux suse-11-sp3 3.0.77-0.11-xen #1 SMP Tue Mar 11 16:48:56 CST 2014
x86_64 x86_64 x86_64 GNU/Linux

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/4.5/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.5
--enable-ssp --disable-libssp --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --disable-libmudflap --with-slibdir=/lib64
--with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --program-suffix=-4.5
--enable-linux-futex --without-system-libunwind --enable-gold
--with-plugin-ld=/usr/bin/gold --with-arch-32=i586 --with-tune=generic
--build=x86_64-suse-linux
Thread model: posix
gcc version 4.5.1 20101208 [gcc-4_5-branch revision 167585] (SUSE Linux)

When I try to compile the source code to x86_64 linuxapp, I got this
error message:

lib/librte_pmd_enic/enic_main.c: In function ‘enic_set_rsskey’:
lib/librte_pmd_enic/enic_main.c:862:2: error: value computed is not used

I dig out that, it was ome issue of  the macros rte_memcpy()
#define rte_memcpy(dst, src, n)              \
        ((__builtin_constant_p(n)) ?          \
        memcpy((dst), (src), (n)) :          \
        rte_memcpy_func((dst), (src), (n)))

When I use only (n) instead of (__builtin_constant_p(n), it will pass( I
know that it was incorrect, just a experiment).

But I try to use inline function instead of macros:
static inline void * rte_memcpy(void *dst, const void *src, size_t n)
{
        return __builtin_constant_p(n) ? memcpy(dst, src, n) :
                                         rte_memcpy_func(dst, src, n);
}

It will pass:), and works, this could be one potential workaround fix.

Who knows why? The root cause is what?

I've no idea about this.

Thanks,
Michael

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2014-12-16  0:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08  9:05 [dpdk-dev] error: value computed is not used Qiu, Michael
2014-12-08 11:00 ` Wodkowski, PawelX
2014-12-08 15:23   ` Qiu, Michael
2014-12-08 15:26     ` Wodkowski, PawelX
2014-12-15 10:54       ` Thomas Monjalon
2014-12-15 11:07         ` [dpdk-dev] [PATCH] enic: fix build on SUSE 11 Thomas Monjalon
2014-12-15 11:27         ` [dpdk-dev] error: value computed is not used Wodkowski, PawelX
2014-12-15 13:26           ` Thomas Monjalon
2014-12-15 13:47             ` Wodkowski, PawelX
2014-12-15 14:16               ` Thomas Monjalon
2014-12-15 15:44                 ` Wodkowski, PawelX
2014-12-15 16:35                   ` Ananyev, Konstantin
2014-12-15 16:00                 ` Ananyev, Konstantin
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

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).