I pushed the following:
commit 7abbc666e9625ac39305e2e801e55ca195634f36
Author: Dustin Sallings <[email protected]>
Date: Sun Mar 27 12:51:08 2011 -0700
Supress fwrite wur in mcstat.
mcstat pulls statistics from memcached and writes them to stdout.
Recent versions of glibc have a warn_unused_result attribute on fwrite
causing this utility to fail to compile.
While this change in glibc is a bit controversial[0], it's the state
of things on some systems today, so this change explicitly ignores the
result of writes to stdout.
[0]: http://sourceware.org/bugzilla/show_bug.cgi?id=11959
diff --git a/programs/mcstat.c b/programs/mcstat.c
index cb5fbfb..7a869fb 100644
--- a/programs/mcstat.c
+++ b/programs/mcstat.c
@@ -105,9 +105,9 @@ static void retry_recv(int sock, void *buf, size_t len) {
*/
static void print(const char *key, int keylen, const char *val, int vallen) {
fputs("STAT ", stdout);
- fwrite(key, keylen, 1, stdout);
+ (void)fwrite(key, keylen, 1, stdout);
fputs(" ", stdout);
- fwrite(val, vallen, 1, stdout);
+ (void)fwrite(val, vallen, 1, stdout);
fputs("\n", stdout);
fflush(stdout);
}
Trond
On 28. mars 2011, at 08.15, Brian Moon wrote:
> On 3/27/11 10:25 PM, Dustin wrote:
>>
>>
>> On Mar 27, 3:15 pm, Brian Moon<[email protected]> wrote:
>>
>>> Compiles and I am running it. Will report any issues I see.
>>
>> Thanks. While I haven't actually reproduced the compiler error
>> (other than in my head), I've submitted a fix for what you reported.
>
> Is it in the branch yet? Still get the same error after a pull.
>
> # cc -v
> Using built-in specs.
> Target: x86_64-pc-linux-gnu
> Configured with:
> /var/tmp/portage/sys-devel/gcc-4.3.4/work/gcc-4.3.4/configure --prefix=/usr
> --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.4
> --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include
> --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.4
> --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.4/man
> --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.4/info
> --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.4/include/g++-v4
> --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
> --disable-fixed-point --enable-nls --without-included-gettext
> --with-system-zlib --disable-checking --disable-werror --enable-secureplt
> --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp
> --disable-libgcj --enable-languages=c,c++,treelang,fortran --enable-shared
> --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
> --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.4 p1.0,
> pie-10.1.5'
> Thread model: posix
> gcc version 4.3.4 (Gentoo 4.3.4 p1.0, pie-10.1.5)
>
> glibc 2.11.2
>
> --
>
> Brian.
> --------
> http://brian.moonspot.net/