allen8807 / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Fails to build with GCC 4.5 on cygwin and opensuse #223

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. git clone ... && git checkout origin/engine-pu
2. config/autorun.sh && -/configure && make

What is the expected output? 

[none]

What do you see instead?

gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -I./include  -I./daemon -I./include   
-fvisibility=hidden -pthread -g -O2 -Wall -Werror -pedantic 
-Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT 
memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o 
memcached-memcached.o `test -f 'daemon/memcached.c' || echo 
'./'`daemon/memcached.c
cc1: warnings being treated as errors
daemon/memcached.c: In function ‘try_read_command’:
daemon/memcached.c:3652:13: error: array subscript is above array bounds
daemon/memcached.c:3652:13: error: array subscript is above array bounds
daemon/memcached.c:3656:18: error: array subscript is above array bounds
daemon/memcached.c:3656:18: error: array subscript is above array bounds
daemon/memcached.c:3656:18: error: array subscript is above array bounds
make[1]: *** [memcached-memcached.o] Error 1
make[1]: Leaving directory `/home/jon/git/memcached'
make: *** [all] Error 2

What version of the product are you using? 

See 'Steps required...'

On what operating system?

OpenSUSE 11.3

jon@torsk:~/git/memcached> uname -a
Linux torsk 2.6.34.10-0.2-desktop #1 SMP PREEMPT 2011-07-20 18:48:56 +0200 
x86_64 x86_64 x86_64 GNU/Linux

Please provide any additional information below.

jon@torsk:~/git/memcached> gcc --version
gcc (SUSE Linux) 4.5.0 20100604 [gcc-4_5-branch revision 160292]

...

jon@torsk:~/git/memcached> aclocal --version
aclocal (GNU automake) 1.11.1

...

jon@torsk:~/git/memcached> make --version
GNU Make 3.81

We suspect that this is a GCC 4.5 issue, since source is known to build with 
4.0.1.

Original issue reported on code.google.com by plasticf...@gmail.com on 8 Sep 2011 at 11:02

GoogleCodeExporter commented 9 years ago
Note I've tried building only engine-pu branch.

Original comment by plasticf...@gmail.com on 8 Sep 2011 at 11:04

GoogleCodeExporter commented 9 years ago
I just built it on a freebsd box with:
gcc (GCC) 4.5.3 20110203 (prerelease)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Original comment by trond.no...@gmail.com on 8 Sep 2011 at 11:16

GoogleCodeExporter commented 9 years ago
The lines complaining on your system is code like: strcmp(command, "on") and 
strcmp(command, "off").. is strcmp a macro by any chance on your system?

Original comment by trond.no...@gmail.com on 8 Sep 2011 at 11:23

GoogleCodeExporter commented 9 years ago
This is the same as Issue 219 - Trond have you looked that one over? I don't 
want to apply the patch without understanding why SUSE is different. Left it 
for when I have more time.

gcc 4.5 is fine, but something odd is going on over there. The user claims it 
compiles after that patch, but that patch only changes one small area and not 
the other twenty times the code does the same thing.

Original comment by dorma...@rydia.net on 9 Sep 2011 at 3:56

GoogleCodeExporter commented 9 years ago
Sorry, I haven't had the time to look at that yet.. The warning seems a bit 
"strange" to me and I don't understand the problem from just briefly look at 
it. I guess I need to install a vm with suse or something so I can try to 
reproduce it (and run the code through the preprocessor and look at stuff it 
actually tries to compile...) I still got a feeling that this could be caused 
by a macro...

Original comment by trond.no...@gmail.com on 9 Sep 2011 at 6:31

GoogleCodeExporter commented 9 years ago
Using GCC 4.5.3 in Cygwin:

$ make
make  all-recursive
make[1]: Entering directory `/cygdrive/j/sdk/memcached'
Making all in doc
make[2]: Entering directory `/cygdrive/j/sdk/memcached/doc'
make  all-am
make[3]: Entering directory `/cygdrive/j/sdk/memcached/doc'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/cygdrive/j/sdk/memcached/doc'
make[2]: Leaving directory `/cygdrive/j/sdk/memcached/doc'
make[2]: Entering directory `/cygdrive/j/sdk/memcached'
gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -DNDEBUG -I/usr/local/include   -g -O2 -pthr
ead -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredund
ant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c
 -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.c
gcc: unrecognized option '-pthread'
cc1: warnings being treated as errors
memcached.c: In function 'sanitycheck':
memcached.c:4384:13: error: array subscript has type 'char'
make[2]: *** [memcached-memcached.o] Error 1
make[2]: Leaving directory `/cygdrive/j/sdk/memcached'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/j/sdk/memcached'
make: *** [all] Error 2

If I edit makefile and remove -Werror from CFLAGS

testapp.c: In function 'cache_redzone_test':
testapp.c:158:12: error: unknown field 'sa_handler' specified in initializer
testapp.c:158:12: warning: missing braces around initializer
testapp.c:158:12: warning: (near initialization for 'action.<anonymous>')
make[2]: *** [testapp.o] Error 1
make[2]: Leaving directory `/cygdrive/j/sdk/memcached'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/j/sdk/memcached'
make: *** [all] Error 2

Original comment by NewEraCr...@gmail.com on 13 Sep 2011 at 6:04

GoogleCodeExporter commented 9 years ago
I don't get any errors on gcc 4.6.1 on debian, 4.6.0 on fedora, or 4.5.2 on 
ubuntu or clang 2.1 on OS X Lion.

Original comment by dsalli...@gmail.com on 28 Sep 2011 at 8:46

GoogleCodeExporter commented 9 years ago

Original comment by dsalli...@gmail.com on 28 Sep 2011 at 8:46

GoogleCodeExporter commented 9 years ago

Original comment by dsalli...@gmail.com on 28 Sep 2011 at 8:49