Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 199 by [email protected]: Memcached compilation fails with GCC 4.6.0
http://code.google.com/p/memcached/issues/detail?id=199

What steps will reproduce the problem?
1. Standard build process
CFLAGS contain "-fno-strict-aliasing" to work around known issue.

./configure --prefix=${INSTPATH} --enable-64bit {plus DTrace on Solaris}
gmake all

What is the expected output? What do you see instead?

With GCC 4.5.2 and the same parameters and versions the build worked fine. Since GCC 4.6.0 treats some warnings as errors, the compilation fails: /opt/SP/gcc/current/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -DNDEBUG -I/opt/SP/build/memcached/libevent-2.0.10-stable/include -I/opt/SP/apps/memcached-1.4.5-intel-x64/include -I/opt/SP/gcc/current/include -I/usr/sfw/include -m64 -m64 -O1 -march=core2 -mfpmath=sse -msse3 -mno-ssse3 -fno-strict-aliasing -I/opt/SP/apps/memcached-1.4.5-intel-x64/include -I/opt/SP/gcc/current/include -I/usr/sfw/include -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-items.o -MD -MP -MF .deps/memcached-items.Tpo -c -o memcached-items.o `test -f 'items.c' || echo './'`items.c
items.c: In function 'do_item_stats_sizes':
items.c:453:21: error: variable 'klen' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

gmake[2]: *** [memcached-items.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
mv -f .deps/memcached-memcached.Tpo .deps/memcached-memcached.Po
gmake[2]: Leaving directory `/opt/SP/build/memcached/memcached-1.4.5'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/SP/build/memcached/memcached-1.4.5'
gmake: *** [all] Error 2

[ Side note: The "-O1" is a workaround for a special bug with GCC 4.6.0, which breaks the DTrace integration of memchached when using any optimization greater O1, but this is a different issue... ]

What version of the product are you using? On what operating system?
memcached 1.4.5
libevent 2.0.10-stable
gcc 4.6.0
Solaris 10 U8+9 x86, Solaris 10 U8 SPARC, CentOS 5.5 x86

Please provide any additional information below.
Compilation fails on all platforms I use. Workaround is adding
"-Wno-error=unused-but-set-variable"
to CFLAGS.
I attached a file with all warnings found on the SPARC box (should be the superset) when compiling using the no-error flag. At least the unused-but-set-variable things need to be fixed to make memcached compile with GCC 4.6.0.

If I can be of any help like testing patches just give me a shout.

BR Martin


Attachments:
        warnings_gcc460.txt  5.9 KB

Reply via email to