diff options
author | Jim Meyering <meyering@redhat.com> | 2009-04-30 08:56:08 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-04-30 08:56:08 +0200 |
commit | e05f6890eda248aedea0681a120bf1a05d8bf6ec (patch) | |
tree | 142d40c8ec62ac7533a12d4ad68ea74caed31896 | |
parent | 32a6710eaa68ad464a03dbc09db3883c8984439c (diff) | |
download | idutils-e05f6890eda248aedea0681a120bf1a05d8bf6ec.tar.gz idutils-e05f6890eda248aedea0681a120bf1a05d8bf6ec.tar.bz2 idutils-e05f6890eda248aedea0681a120bf1a05d8bf6ec.zip |
build: suppress warnings about ignored return value from fread/fwrite
* libidu/idwrite.c: include "ignore-value.h".
(io_write): Ignore fwrite return value.
* libidu/idread.c: Likewise for fread.
* bootstrap.conf (gnulib_modules): Add ignore-value.
-rw-r--r-- | bootstrap.conf | 1 | ||||
-rw-r--r-- | libidu/idread.c | 9 | ||||
-rw-r--r-- | libidu/idwrite.c | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index 99b1e1e..a683ab5 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -51,6 +51,7 @@ gnulib_modules=" gnumakefile gnupload havelib + ignore-value inttostr lstat malloc diff --git a/libidu/idread.c b/libidu/idread.c index 3116a1a..0900743 100644 --- a/libidu/idread.c +++ b/libidu/idread.c @@ -25,10 +25,11 @@ #include <xalloc.h> #include <error.h> -#include "idfile.h" #include "hash.h" -#include "xnls.h" +#include "idfile.h" #include "iduglobal.h" +#include "ignore-value.h" +#include "xnls.h" static int fgets0 (char *buf0, int size, FILE *in_FILE); @@ -192,7 +193,9 @@ io_read (FILE *input_FILE, void *addr, unsigned int size, int io_type) else if (io_type == IO_TYPE_STR) fgets0 (addr, size, input_FILE); else if (io_type == IO_TYPE_FIX) - fread (addr, size, 1, input_FILE); + { + ignore_value (fread (addr, size, 1, input_FILE)); + } else error (0, 0, _("unknown I/O type: %d"), io_type); return size; diff --git a/libidu/idwrite.c b/libidu/idwrite.c index 00fc205..effd104 100644 --- a/libidu/idwrite.c +++ b/libidu/idwrite.c @@ -1,5 +1,5 @@ /* idwrite.c -- functions to write ID database files - Copyright (C) 1995, 1996, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Greg McGary <gkm@gnu.ai.mit.edu> This program is free software; you can redistribute it and/or modify @@ -23,6 +23,7 @@ #include <error.h> #include "idfile.h" +#include "ignore-value.h" #include "hash.h" #include "xnls.h" @@ -163,7 +164,7 @@ io_write (FILE *output_FILE, void *addr, unsigned int size, int io_type) putc ('\0', output_FILE); } else if (io_type == IO_TYPE_FIX) - fwrite (addr, size, 1, output_FILE); + ignore_value (fwrite (addr, size, 1, output_FILE)); else error (0, 0, _("unknown I/O type: %d"), io_type); return size; |