jyhkss / memcached

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

A compile warning #374

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I package a memcached.rpm on CentOS 6.3;
2. The default option of gcc is warnings being treated as errors;
3. Then an error happened.

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

What version of the product are you using? On what operating system?
tag1.4.20

Please provide any additional information below.

gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -DNDEBUG   -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -pthread -pthread -Wall -Werror 
-pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls 
-fno-strict-aliasing -MT memcached-memcached.o -MD -MP -MF 
.deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 
'memcached.c' || echo './'`memcached.c
cc1: warnings being treated as errors
memcached.c: In function 'process_bin_get_or_touch':
memcached.c:1277: error: ignoring return value of 'fwrite', declared with 
attribute warn_unused_result
make[2]: *** [memcached-memcached.o] Error 1
make[2]: Leaving directory `/root/rpmbuild/BUILD/memcached-1.4.20'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/memcached-1.4.20'
make: *** [all] Error 2

Original issue reported on code.google.com by Z.W.Chan...@gmail.com on 12 Aug 2014 at 2:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have the same issue on SuSE Enterprise Linux 11 SP3. Attempting to compile on 
s390x architecture.

I was able to compile version 1.4.17, but nothing higher than that will compile.

Perhaps incompatibility with an older gcc version?

Original comment by matthew....@gmail.com on 25 Aug 2014 at 10:08

GoogleCodeExporter commented 9 years ago
In my case, cause by the gcc option to process warning as err:
      -Werror
           Make all warnings into errors.

Original comment by Z.W.Chan...@gmail.com on 27 Aug 2014 at 4:48

GoogleCodeExporter commented 9 years ago
Having just the same issue for both CentOS 5/6.

Original comment by den...@gmail.com on 26 Nov 2014 at 9:47

GoogleCodeExporter commented 9 years ago
Having poked into this at somewhat excessive length yesterday, I think this is 
an issue with some versions of glibc:

https://sourceware.org/bugzilla/show_bug.cgi?id=11959

The bug shows it as fixed in version 2.13, but CentOS 6 uses 2.12, and will 
forever after, so patching this for those of us who are still using that 
release would seem helpful.  The attached patch does make the bug go away, 
though I'm a little dubious about it: it *should* optimize away the pointless 
branch, right?

Original comment by bwarfi...@amplify.com on 14 Jan 2015 at 3:31

Attachments: