bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

avoid some warnings


From: Eric Blake
Subject: avoid some warnings
Date: Mon, 01 Feb 2010 06:46:23 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

In the process of preparing to release m4 1.4.14, I noticed several
warnings when compiling on Fedora Core 12.  I'm still working on silencing
the warning about gettimeofday having an incompatible second argument type
on glibc when using _GNU_SOURCE; I think the only sane solution is to
define GETTIMEOFDAY_TIMEZONE to either 'struct timezone' or 'void', and
recommend that application writers that need to use a function pointer use
the prototype:
int (*f) (struct timeval *, GETTIMEOFDAY_TIMEZONE *);

then updating the signature check in tests/test-gettimeofday.c
accordingly.  But in the meantime, here's what I'm pushing as prerequisite
to fixing gettimeofday:

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
From 3220d5c6210870672d55ab27482fcdd1e964d75d Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sat, 30 Jan 2010 07:37:11 -0700
Subject: [PATCH 1/3] tests: silence warning about system return

Silence a compiler warning for platforms that mark system()
with attribute warn_unused_result.

* tests/test-areadlink-with-size.c (main): Ignore system result.
* tests/test-areadlink.c (main): Likewise.
* tests/test-areadlinkat-with-size.c (main): Likewise.
* tests/test-areadlinkat.c (main): Likewise.
* tests/test-canonicalize-lgpl.c (main): Likewise.
* tests/test-canonicalize.c (main): Likewise.
* tests/test-chown.c (main): Likewise.
* tests/test-fchownat.c (main): Likewise.
* tests/test-fdutimensat.c (main): Likewise.
* tests/test-fstatat.c (main): Likewise.
* tests/test-futimens.c (main): Likewise.
* tests/test-lchown.c (main): Likewise.
* tests/test-link.c (main): Likewise.
* tests/test-linkat.c (main): Likewise.
* tests/test-lstat.c (main): Likewise.
* tests/test-mkdir.c (main): Likewise.
* tests/test-mkdirat.c (main): Likewise.
* tests/test-mkfifo.c (main): Likewise.
* tests/test-mkfifoat.c (main): Likewise.
* tests/test-mknod.c (main): Likewise.
* tests/test-readlink.c (main): Likewise.
* tests/test-remove.c (main): Likewise.
* tests/test-rename.c (main): Likewise.
* tests/test-renameat.c (main): Likewise.
* tests/test-rmdir.c (main): Likewise.
* tests/test-symlink.c (main): Likewise.
* tests/test-symlinkat.c (main): Likewise.
* tests/test-unlink.c (main): Likewise.
* tests/test-unlinkat.c (main): Likewise.
* tests/test-utimens.c (main): Likewise.
* tests/test-utimensat.c (main): Likewise.
* modules/areadlink-tests (Depends-on): Add ignore-value.
* modules/areadlink-with-size-tests (Depends-on): Likewise.
* modules/areadlinkat-tests (Depends-on): Likewise.
* modules/areadlinkat-with-size-tests (Depends-on): Likewise.
* modules/canonicalize-lgpl-tests (Depends-on): Likewise.
* modules/canonicalize-tests (Depends-on): Likewise.
* modules/chown-tests (Depends-on): Likewise.
* modules/fdutimensat-tests (Depends-on): Likewise.
* modules/futimens-tests (Depends-on): Likewise.
* modules/lchown-tests (Depends-on): Likewise.
* modules/link-tests (Depends-on): Likewise.
* modules/linkat-tests (Depends-on): Likewise.
* modules/lstat-tests (Depends-on): Likewise.
* modules/mkdir-tests (Depends-on): Likewise.
* modules/mkfifo-tests (Depends-on): Likewise.
* modules/mkfifoat-tests (Depends-on): Likewise.
* modules/mknod-tests (Depends-on): Likewise.
* modules/openat-tests (Depends-on): Likewise.
* modules/readlink-tests (Depends-on): Likewise.
* modules/remove-tests (Depends-on): Likewise.
* modules/rename-tests (Depends-on): Likewise.
* modules/renameat-tests (Depends-on): Likewise.
* modules/rmdir-tests (Depends-on): Likewise.
* modules/symlink-tests (Depends-on): Likewise.
* modules/symlinkat-tests (Depends-on): Likewise.
* modules/unlink-tests (Depends-on): Likewise.
* modules/utimens-tests (Depends-on): Likewise.
* modules/utimensat-tests (Depends-on): Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                           |   63 +++++++++++++++++++++++++++++++++++
 modules/areadlink-tests             |    1 +
 modules/areadlink-with-size-tests   |    1 +
 modules/areadlinkat-tests           |    1 +
 modules/areadlinkat-with-size-tests |    1 +
 modules/canonicalize-lgpl-tests     |    1 +
 modules/canonicalize-tests          |    1 +
 modules/chown-tests                 |    1 +
 modules/fdutimensat-tests           |    1 +
 modules/futimens-tests              |    1 +
 modules/lchown-tests                |    1 +
 modules/link-tests                  |    1 +
 modules/linkat-tests                |    1 +
 modules/lstat-tests                 |    1 +
 modules/mkdir-tests                 |    1 +
 modules/mkfifo-tests                |    1 +
 modules/mkfifoat-tests              |    1 +
 modules/mknod-tests                 |    1 +
 modules/openat-tests                |    1 +
 modules/readlink-tests              |    1 +
 modules/remove-tests                |    1 +
 modules/rename-tests                |    1 +
 modules/renameat-tests              |    1 +
 modules/rmdir-tests                 |    1 +
 modules/symlink-tests               |    1 +
 modules/symlinkat-tests             |    1 +
 modules/unlink-tests                |    1 +
 modules/utimens-tests               |    1 +
 modules/utimensat-tests             |    1 +
 tests/test-areadlink-with-size.c    |    3 +-
 tests/test-areadlink.c              |    3 +-
 tests/test-areadlinkat-with-size.c  |    3 +-
 tests/test-areadlinkat.c            |    3 +-
 tests/test-canonicalize-lgpl.c      |    3 +-
 tests/test-canonicalize.c           |    3 +-
 tests/test-chown.c                  |    3 +-
 tests/test-fchownat.c               |    3 +-
 tests/test-fdutimensat.c            |    3 +-
 tests/test-fstatat.c                |    3 +-
 tests/test-futimens.c               |    3 +-
 tests/test-lchown.c                 |    3 +-
 tests/test-link.c                   |    3 +-
 tests/test-linkat.c                 |    3 +-
 tests/test-lstat.c                  |    3 +-
 tests/test-mkdir.c                  |    3 +-
 tests/test-mkdirat.c                |    3 +-
 tests/test-mkfifo.c                 |    3 +-
 tests/test-mkfifoat.c               |    3 +-
 tests/test-mknod.c                  |    3 +-
 tests/test-readlink.c               |    3 +-
 tests/test-remove.c                 |    3 +-
 tests/test-rename.c                 |    3 +-
 tests/test-renameat.c               |    3 +-
 tests/test-rmdir.c                  |    3 +-
 tests/test-symlink.c                |    3 +-
 tests/test-symlinkat.c              |    3 +-
 tests/test-unlink.c                 |    3 +-
 tests/test-unlinkat.c               |    3 +-
 tests/test-utimens.c                |    3 +-
 tests/test-utimensat.c              |    3 +-
 60 files changed, 153 insertions(+), 31 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 335da1a..b3c6f3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+2010-02-01  Eric Blake  <address@hidden>
+
+       tests: silence warning about system return
+       * tests/test-areadlink-with-size.c (main): Ignore system result.
+       * tests/test-areadlink.c (main): Likewise.
+       * tests/test-areadlinkat-with-size.c (main): Likewise.
+       * tests/test-areadlinkat.c (main): Likewise.
+       * tests/test-canonicalize-lgpl.c (main): Likewise.
+       * tests/test-canonicalize.c (main): Likewise.
+       * tests/test-chown.c (main): Likewise.
+       * tests/test-fchownat.c (main): Likewise.
+       * tests/test-fdutimensat.c (main): Likewise.
+       * tests/test-fstatat.c (main): Likewise.
+       * tests/test-futimens.c (main): Likewise.
+       * tests/test-lchown.c (main): Likewise.
+       * tests/test-link.c (main): Likewise.
+       * tests/test-linkat.c (main): Likewise.
+       * tests/test-lstat.c (main): Likewise.
+       * tests/test-mkdir.c (main): Likewise.
+       * tests/test-mkdirat.c (main): Likewise.
+       * tests/test-mkfifo.c (main): Likewise.
+       * tests/test-mkfifoat.c (main): Likewise.
+       * tests/test-mknod.c (main): Likewise.
+       * tests/test-readlink.c (main): Likewise.
+       * tests/test-remove.c (main): Likewise.
+       * tests/test-rename.c (main): Likewise.
+       * tests/test-renameat.c (main): Likewise.
+       * tests/test-rmdir.c (main): Likewise.
+       * tests/test-symlink.c (main): Likewise.
+       * tests/test-symlinkat.c (main): Likewise.
+       * tests/test-unlink.c (main): Likewise.
+       * tests/test-unlinkat.c (main): Likewise.
+       * tests/test-utimens.c (main): Likewise.
+       * tests/test-utimensat.c (main): Likewise.
+       * modules/areadlink-tests (Depends-on): Add ignore-value.
+       * modules/areadlink-with-size-tests (Depends-on): Likewise.
+       * modules/areadlinkat-tests (Depends-on): Likewise.
+       * modules/areadlinkat-with-size-tests (Depends-on): Likewise.
+       * modules/canonicalize-lgpl-tests (Depends-on): Likewise.
+       * modules/canonicalize-tests (Depends-on): Likewise.
+       * modules/chown-tests (Depends-on): Likewise.
+       * modules/fdutimensat-tests (Depends-on): Likewise.
+       * modules/futimens-tests (Depends-on): Likewise.
+       * modules/lchown-tests (Depends-on): Likewise.
+       * modules/link-tests (Depends-on): Likewise.
+       * modules/linkat-tests (Depends-on): Likewise.
+       * modules/lstat-tests (Depends-on): Likewise.
+       * modules/mkdir-tests (Depends-on): Likewise.
+       * modules/mkfifo-tests (Depends-on): Likewise.
+       * modules/mkfifoat-tests (Depends-on): Likewise.
+       * modules/mknod-tests (Depends-on): Likewise.
+       * modules/openat-tests (Depends-on): Likewise.
+       * modules/readlink-tests (Depends-on): Likewise.
+       * modules/remove-tests (Depends-on): Likewise.
+       * modules/rename-tests (Depends-on): Likewise.
+       * modules/renameat-tests (Depends-on): Likewise.
+       * modules/rmdir-tests (Depends-on): Likewise.
+       * modules/symlink-tests (Depends-on): Likewise.
+       * modules/symlinkat-tests (Depends-on): Likewise.
+       * modules/unlink-tests (Depends-on): Likewise.
+       * modules/utimens-tests (Depends-on): Likewise.
+       * modules/utimensat-tests (Depends-on): Likewise.
+
 2010-01-31  Bruno Haible  <address@hidden>

        Perform the same test for many <math.h> functions.
diff --git a/modules/areadlink-tests b/modules/areadlink-tests
index 37c26c2..869be2c 100644
--- a/modules/areadlink-tests
+++ b/modules/areadlink-tests
@@ -4,6 +4,7 @@ tests/test-areadlink.c
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/areadlink-with-size-tests 
b/modules/areadlink-with-size-tests
index 1dddea8..b9b3ded 100644
--- a/modules/areadlink-with-size-tests
+++ b/modules/areadlink-with-size-tests
@@ -4,6 +4,7 @@ tests/test-areadlink-with-size.c
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/areadlinkat-tests b/modules/areadlinkat-tests
index 45a8d48..422ac61 100644
--- a/modules/areadlinkat-tests
+++ b/modules/areadlinkat-tests
@@ -4,6 +4,7 @@ tests/test-areadlinkat.c
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/areadlinkat-with-size-tests 
b/modules/areadlinkat-with-size-tests
index 972bc3e..b86d6e7 100644
--- a/modules/areadlinkat-with-size-tests
+++ b/modules/areadlinkat-with-size-tests
@@ -4,6 +4,7 @@ tests/test-areadlinkat-with-size.c
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool

 configure.ac:
diff --git a/modules/canonicalize-lgpl-tests b/modules/canonicalize-lgpl-tests
index bc07ea3..fd49d69 100644
--- a/modules/canonicalize-lgpl-tests
+++ b/modules/canonicalize-lgpl-tests
@@ -4,6 +4,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 same-inode
 symlink

diff --git a/modules/canonicalize-tests b/modules/canonicalize-tests
index fb18d66..9b5acd8 100644
--- a/modules/canonicalize-tests
+++ b/modules/canonicalize-tests
@@ -3,6 +3,7 @@ tests/test-canonicalize.c
 tests/macros.h

 Depends-on:
+ignore-value
 progname
 same-inode
 symlink
diff --git a/modules/chown-tests b/modules/chown-tests
index 68f74f0..359ba1b 100644
--- a/modules/chown-tests
+++ b/modules/chown-tests
@@ -6,6 +6,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 lstat
 mgetgroups
 progname
diff --git a/modules/fdutimensat-tests b/modules/fdutimensat-tests
index dc55c45..48ea78d 100644
--- a/modules/fdutimensat-tests
+++ b/modules/fdutimensat-tests
@@ -8,6 +8,7 @@ tests/test-fdutimensat.c
 tests/macros.h

 Depends-on:
+ignore-value
 progname
 timespec
 usleep
diff --git a/modules/futimens-tests b/modules/futimens-tests
index 330711d..124b62f 100644
--- a/modules/futimens-tests
+++ b/modules/futimens-tests
@@ -7,6 +7,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 timespec
 usleep
 utimecmp
diff --git a/modules/lchown-tests b/modules/lchown-tests
index f3935d6..72ab3c1 100644
--- a/modules/lchown-tests
+++ b/modules/lchown-tests
@@ -6,6 +6,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 mgetgroups
 progname
 usleep
diff --git a/modules/link-tests b/modules/link-tests
index b7fb2ff..5b1978e 100644
--- a/modules/link-tests
+++ b/modules/link-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 errno
 stdbool
 sys_stat
diff --git a/modules/linkat-tests b/modules/linkat-tests
index 602d18a..6df4781 100644
--- a/modules/linkat-tests
+++ b/modules/linkat-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 areadlink-with-size
 filenamecat
 progname
diff --git a/modules/lstat-tests b/modules/lstat-tests
index a0296a6..911a7ff 100644
--- a/modules/lstat-tests
+++ b/modules/lstat-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 errno
 same-inode
 stdbool
diff --git a/modules/mkdir-tests b/modules/mkdir-tests
index 5f455c7..fea1b63 100644
--- a/modules/mkdir-tests
+++ b/modules/mkdir-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/mkfifo-tests b/modules/mkfifo-tests
index 1f92a41..00ca98f 100644
--- a/modules/mkfifo-tests
+++ b/modules/mkfifo-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/mkfifoat-tests b/modules/mkfifoat-tests
index 5e72b94..8be33df 100644
--- a/modules/mkfifoat-tests
+++ b/modules/mkfifoat-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 symlink

 configure.ac:
diff --git a/modules/mknod-tests b/modules/mknod-tests
index c273f66..e35ffec 100644
--- a/modules/mknod-tests
+++ b/modules/mknod-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/openat-tests b/modules/openat-tests
index 489601c..250a574 100644
--- a/modules/openat-tests
+++ b/modules/openat-tests
@@ -16,6 +16,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 mgetgroups
 pathmax
 usleep
diff --git a/modules/readlink-tests b/modules/readlink-tests
index 1aeac92..cbd84a5 100644
--- a/modules/readlink-tests
+++ b/modules/readlink-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/remove-tests b/modules/remove-tests
index 9e2e49c..498c7d6 100644
--- a/modules/remove-tests
+++ b/modules/remove-tests
@@ -4,6 +4,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 symlink
 sys_stat

diff --git a/modules/rename-tests b/modules/rename-tests
index 84c4a3f..339ecdf 100644
--- a/modules/rename-tests
+++ b/modules/rename-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 errno
 link
 stdbool
diff --git a/modules/renameat-tests b/modules/renameat-tests
index 53467db..dcef7c1 100644
--- a/modules/renameat-tests
+++ b/modules/renameat-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 filenamecat
 progname
 xgetcwd
diff --git a/modules/rmdir-tests b/modules/rmdir-tests
index 5619ad5..19a5240 100644
--- a/modules/rmdir-tests
+++ b/modules/rmdir-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink

diff --git a/modules/symlink-tests b/modules/symlink-tests
index 3f94fd2..a07074e 100644
--- a/modules/symlink-tests
+++ b/modules/symlink-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool

 configure.ac:
diff --git a/modules/symlinkat-tests b/modules/symlinkat-tests
index e3ee6c3..c1678c0 100644
--- a/modules/symlinkat-tests
+++ b/modules/symlinkat-tests
@@ -6,6 +6,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value

 configure.ac:

diff --git a/modules/unlink-tests b/modules/unlink-tests
index f49fe4d..6a57d49 100644
--- a/modules/unlink-tests
+++ b/modules/unlink-tests
@@ -5,6 +5,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 stdbool
 symlink
 unlinkdir
diff --git a/modules/utimens-tests b/modules/utimens-tests
index a9ddd27..d0566a6 100644
--- a/modules/utimens-tests
+++ b/modules/utimens-tests
@@ -8,6 +8,7 @@ tests/test-utimens.c
 tests/macros.h

 Depends-on:
+ignore-value
 symlink
 timespec
 usleep
diff --git a/modules/utimensat-tests b/modules/utimensat-tests
index 75516d8..26dbac6 100644
--- a/modules/utimensat-tests
+++ b/modules/utimensat-tests
@@ -8,6 +8,7 @@ tests/signature.h
 tests/macros.h

 Depends-on:
+ignore-value
 progname
 timespec
 usleep
diff --git a/tests/test-areadlink-with-size.c b/tests/test-areadlink-with-size.c
index ae56883..2344390 100644
--- a/tests/test-areadlink-with-size.c
+++ b/tests/test-areadlink-with-size.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-areadlink-with-size.t"
@@ -39,7 +40,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_areadlink (areadlink_with_size, true);
 }
diff --git a/tests/test-areadlink.c b/tests/test-areadlink.c
index 7521df0..c3e5822 100644
--- a/tests/test-areadlink.c
+++ b/tests/test-areadlink.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-areadlink.t"
@@ -46,7 +47,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_areadlink (do_areadlink, true);
 }
diff --git a/tests/test-areadlinkat-with-size.c 
b/tests/test-areadlinkat-with-size.c
index 9fab370..f709ea8 100644
--- a/tests/test-areadlinkat-with-size.c
+++ b/tests/test-areadlinkat-with-size.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-areadlinkat-with-size.t"
@@ -50,7 +51,7 @@ main (void)
   int result;

   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Basic tests.  */
   result = test_areadlink (do_areadlinkat_with_size, false);
diff --git a/tests/test-areadlinkat.c b/tests/test-areadlinkat.c
index cb5848a..c93a2d8 100644
--- a/tests/test-areadlinkat.c
+++ b/tests/test-areadlinkat.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-areadlinkat.t"
@@ -50,7 +51,7 @@ main (void)
   int result;

   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Basic tests.  */
   result = test_areadlink (do_areadlinkat, false);
diff --git a/tests/test-canonicalize-lgpl.c b/tests/test-canonicalize-lgpl.c
index 816b401..cbf481d 100644
--- a/tests/test-canonicalize-lgpl.c
+++ b/tests/test-canonicalize-lgpl.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (canonicalize_file_name, char *, (const char 
*));
 #include <unistd.h>

 #include "same-inode.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "t-can-lgpl.tmp"
@@ -55,7 +56,7 @@ main (void)
      any leftovers from a previous partial run.  */
   {
     int fd;
-    system ("rm -rf " BASE " ise");
+    ignore_value (system ("rm -rf " BASE " ise"));
     ASSERT (mkdir (BASE, 0700) == 0);
     fd = creat (BASE "/tra", 0600);
     ASSERT (0 <= fd);
diff --git a/tests/test-canonicalize.c b/tests/test-canonicalize.c
index b3086b1..f8d3536 100644
--- a/tests/test-canonicalize.c
+++ b/tests/test-canonicalize.c
@@ -29,6 +29,7 @@
 #include <unistd.h>

 #include "same-inode.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "t-can.tmp"
@@ -46,7 +47,7 @@ main (void)
      any leftovers from a previous partial run.  */
   {
     int fd;
-    system ("rm -rf " BASE " ise");
+    ignore_value (system ("rm -rf " BASE " ise"));
     ASSERT (mkdir (BASE, 0700) == 0);
     fd = creat (BASE "/tra", 0600);
     ASSERT (0 <= fd);
diff --git a/tests/test-chown.c b/tests/test-chown.c
index 57bb810..380c9a3 100644
--- a/tests/test-chown.c
+++ b/tests/test-chown.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (chown, int, (char const *, uid_t, gid_t));

 #include "mgetgroups.h"
 #include "stat-time.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-chown.t"
@@ -42,7 +43,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_chown (chown, true);
 }
diff --git a/tests/test-fchownat.c b/tests/test-fchownat.c
index 7bc7633..0843be7 100644
--- a/tests/test-fchownat.c
+++ b/tests/test-fchownat.c
@@ -33,6 +33,7 @@ SIGNATURE_CHECK (fchownat, int, (int, char const *, uid_t, 
gid_t, int));
 #include "mgetgroups.h"
 #include "openat.h"
 #include "stat-time.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-fchownat.t"
@@ -63,7 +64,7 @@ main (void)
   int result2; /* Skip because of no lchown support.  */

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Basic tests.  */
   result1 = test_chown (do_chown, true);
diff --git a/tests/test-fdutimensat.c b/tests/test-fdutimensat.c
index 77a6d94..949ca47 100644
--- a/tests/test-fdutimensat.c
+++ b/tests/test-fdutimensat.c
@@ -25,6 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-fdutimensat.t"
@@ -84,7 +85,7 @@ main (void)
   int fd;

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Basic tests.  */
   result1 = test_utimens (do_utimens, true);
diff --git a/tests/test-fstatat.c b/tests/test-fstatat.c
index 89cd079..63e5a13 100644
--- a/tests/test-fstatat.c
+++ b/tests/test-fstatat.c
@@ -33,6 +33,7 @@ SIGNATURE_CHECK (fstatat, int, (int, char const *, struct 
stat *, int));
 #include "openat.h"
 #include "pathmax.h"
 #include "same-inode.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-fstatat.t"
@@ -62,7 +63,7 @@ main (void)
   int result;

   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   result = test_stat_func (do_stat, false);
   ASSERT (test_lstat_func (do_lstat, false) == result);
diff --git a/tests/test-futimens.c b/tests/test-futimens.c
index 99b9903..e555312 100644
--- a/tests/test-futimens.c
+++ b/tests/test-futimens.c
@@ -34,6 +34,7 @@ SIGNATURE_CHECK (futimens, int, (int, struct timespec 
const[2]));
 #include "stat-time.h"
 #include "timespec.h"
 #include "utimecmp.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-futimens.t"
@@ -44,7 +45,7 @@ int
 main (void)
 {
   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_futimens (futimens, true);
 }
diff --git a/tests/test-lchown.c b/tests/test-lchown.c
index ce2da40..9b868eb 100644
--- a/tests/test-lchown.c
+++ b/tests/test-lchown.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (lchown, int, (char const *, uid_t, gid_t));

 #include "mgetgroups.h"
 #include "stat-time.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-lchown.t"
@@ -42,7 +43,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_lchown (lchown, true);
 }
diff --git a/tests/test-link.c b/tests/test-link.c
index 17b1b82..65ee9e0 100644
--- a/tests/test-link.c
+++ b/tests/test-link.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (link, int, (char const *, char const *));
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-link.t"
@@ -40,7 +41,7 @@ int
 main (void)
 {
   /* Remove any garbage left from previous partial runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_link (link, true);
 }
diff --git a/tests/test-linkat.c b/tests/test-linkat.c
index c2ad0e5..1dbfad5 100644
--- a/tests/test-linkat.c
+++ b/tests/test-linkat.c
@@ -34,6 +34,7 @@ SIGNATURE_CHECK (linkat, int, (int, char const *, int, char 
const *, int));
 #include "filenamecat.h"
 #include "same-inode.h"
 #include "xgetcwd.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-linkat.t"
@@ -81,7 +82,7 @@ main (void)
   int result;

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Test basic link functionality, without mentioning symlinks.  */
   result = test_link (do_link, true);
diff --git a/tests/test-lstat.c b/tests/test-lstat.c
index 23ffec4..b8f9237 100644
--- a/tests/test-lstat.c
+++ b/tests/test-lstat.c
@@ -35,6 +35,7 @@ SIGNATURE_CHECK (lstat, int, (char const *, struct stat *));
 #include <unistd.h>

 #include "same-inode.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-lstat.t"
@@ -53,7 +54,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_lstat_func (do_lstat, true);
 }
diff --git a/tests/test-mkdir.c b/tests/test-mkdir.c
index 771758e..47b242a 100644
--- a/tests/test-mkdir.c
+++ b/tests/test-mkdir.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (mkdir, int, (char const *, mode_t));
 #include <stdlib.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-mkdir.t"
@@ -40,7 +41,7 @@ int
 main (void)
 {
   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_mkdir (mkdir, true);
 }
diff --git a/tests/test-mkdirat.c b/tests/test-mkdirat.c
index 9aee33a..c745196 100644
--- a/tests/test-mkdirat.c
+++ b/tests/test-mkdirat.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (mkdirat, int, (int, char const *, mode_t));
 #include <stdlib.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-mkdirat.t"
@@ -51,7 +52,7 @@ main (void)
   int result;

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Test basic mkdir functionality.  */
   result = test_mkdir (do_mkdir, false);
diff --git a/tests/test-mkfifo.c b/tests/test-mkfifo.c
index 84f4a8b..ecc9570 100644
--- a/tests/test-mkfifo.c
+++ b/tests/test-mkfifo.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (mkfifo, int, (char const *, mode_t));
 #include <stdlib.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-mkfifo.t"
@@ -40,7 +41,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_mkfifo (mkfifo, true);
 }
diff --git a/tests/test-mkfifoat.c b/tests/test-mkfifoat.c
index 01fc4da..1651143 100644
--- a/tests/test-mkfifoat.c
+++ b/tests/test-mkfifoat.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (mknodat, int, (int, char const *, mode_t, 
dev_t));
 #include <string.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-mkfifoat.t"
@@ -72,7 +73,7 @@ main (void)
   int result;

   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Basic tests.  */
   result = test_mkfifo (do_mkfifoat, true);
diff --git a/tests/test-mknod.c b/tests/test-mknod.c
index 5d19f5f..16f48e9 100644
--- a/tests/test-mknod.c
+++ b/tests/test-mknod.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (mknod, int, (char const *, mode_t, dev_t));
 #include <stdlib.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-mknod.t"
@@ -47,7 +48,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* We can only portably test creation of fifos.  Anything else
      requires root privileges and knowledge of device numbers.  */
diff --git a/tests/test-readlink.c b/tests/test-readlink.c
index 4fb3a00..a144964 100644
--- a/tests/test-readlink.c
+++ b/tests/test-readlink.c
@@ -31,6 +31,7 @@ SIGNATURE_CHECK (readlink, ssize_t, (char const *, char *, 
size_t));
 #include <string.h>
 #include <sys/stat.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-readlink.t"
@@ -41,7 +42,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_readlink (readlink, true);
 }
diff --git a/tests/test-remove.c b/tests/test-remove.c
index 870878e..4dffcaf 100644
--- a/tests/test-remove.c
+++ b/tests/test-remove.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (remove, int, (char const *));
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-remove.t"
@@ -38,7 +39,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Setup.  */
   ASSERT (mkdir (BASE "dir", 0700) == 0);
diff --git a/tests/test-rename.c b/tests/test-rename.c
index 10cabf1..c5c6c43 100644
--- a/tests/test-rename.c
+++ b/tests/test-rename.c
@@ -29,6 +29,7 @@ SIGNATURE_CHECK (rename, int, (char const *, char const *));
 #include <sys/stat.h>
 #include <unistd.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-rename.t"
@@ -39,7 +40,7 @@ int
 main (void)
 {
   /* Remove any garbage left from previous partial runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_rename (rename, true);
 }
diff --git a/tests/test-renameat.c b/tests/test-renameat.c
index 687700e..e5fefa1 100644
--- a/tests/test-renameat.c
+++ b/tests/test-renameat.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (renameat, int, (int, char const *, int, char 
const *));

 #include "filenamecat.h"
 #include "xgetcwd.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-renameat.t"
@@ -57,7 +58,7 @@ main (void)
   int result;

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Test basic rename functionality, using current directory.  */
   result = test_rename (do_rename, false);
diff --git a/tests/test-rmdir.c b/tests/test-rmdir.c
index a155e1b..7b1ef37 100644
--- a/tests/test-rmdir.c
+++ b/tests/test-rmdir.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (rmdir, int, (char const *));
 #include <stdlib.h>
 #include <sys/stat.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-rmdir.t"
@@ -40,7 +41,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_rmdir_func (rmdir, true);
 }
diff --git a/tests/test-symlink.c b/tests/test-symlink.c
index 2369773..d2df54c 100644
--- a/tests/test-symlink.c
+++ b/tests/test-symlink.c
@@ -30,6 +30,7 @@ SIGNATURE_CHECK (symlink, int, (char const *, char const *));
 #include <stdlib.h>
 #include <sys/stat.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-symlink.t"
@@ -40,7 +41,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_symlink (symlink, true);
 }
diff --git a/tests/test-symlinkat.c b/tests/test-symlinkat.c
index 7ac3f58..c3dec29 100644
--- a/tests/test-symlinkat.c
+++ b/tests/test-symlinkat.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (readlinkat, ssize_t, (int, char const *, 
char *, size_t));
 #include <string.h>
 #include <sys/stat.h>

+#include "ignore-value.h"
 #include "macros.h"

 #ifndef HAVE_SYMLINK
@@ -64,7 +65,7 @@ main (void)
   int result;

   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Perform same checks as counterpart functions.  */
   result = test_readlink (do_readlink, false);
diff --git a/tests/test-unlink.c b/tests/test-unlink.c
index 3d63a31..4f7de5f 100644
--- a/tests/test-unlink.c
+++ b/tests/test-unlink.c
@@ -32,6 +32,7 @@ SIGNATURE_CHECK (unlink, int, (char const *));
 #include <sys/stat.h>

 #include "unlinkdir.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-unlink.t"
@@ -42,7 +43,7 @@ int
 main (void)
 {
   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   return test_unlink_func (unlink, true);
 }
diff --git a/tests/test-unlinkat.c b/tests/test-unlinkat.c
index e0cc1c5..7d80574 100644
--- a/tests/test-unlinkat.c
+++ b/tests/test-unlinkat.c
@@ -31,6 +31,7 @@ SIGNATURE_CHECK (unlinkat, int, (int, char const *, int));
 #include <sys/stat.h>

 #include "unlinkdir.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-unlinkat.t"
@@ -62,7 +63,7 @@ main (void)
   int result2;

   /* Remove any leftovers from a previous partial run.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   result1 = test_rmdir_func (rmdirat, false);
   result2 = test_unlink_func (unlinker, false);
diff --git a/tests/test-utimens.c b/tests/test-utimens.c
index ae2402d..f2a31a8 100644
--- a/tests/test-utimens.c
+++ b/tests/test-utimens.c
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>

+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-utimens.t"
@@ -66,7 +67,7 @@ main (void)
   int result3; /* Skip because of no lutimens support.  */

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   result1 = test_utimens (utimens, true);
   ASSERT (test_utimens (do_fdutimens, false) == result1);
diff --git a/tests/test-utimensat.c b/tests/test-utimensat.c
index 68dab5c..07bdc31 100644
--- a/tests/test-utimensat.c
+++ b/tests/test-utimensat.c
@@ -35,6 +35,7 @@ SIGNATURE_CHECK (utimensat, int, (int, char const *, struct 
timespec const[2],
 #include "stat-time.h"
 #include "timespec.h"
 #include "utimecmp.h"
+#include "ignore-value.h"
 #include "macros.h"

 #define BASE "test-utimensat.t"
@@ -66,7 +67,7 @@ main (void)
   int fd;

   /* Clean up any trash from prior testsuite runs.  */
-  system ("rm -rf " BASE "*");
+  ignore_value (system ("rm -rf " BASE "*"));

   /* Basic tests.  */
   result1 = test_utimens (do_utimensat, true);
-- 
1.6.4.2


From 94e727094e8d312df85d93a3f9f98cb43a5abb1d Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sat, 30 Jan 2010 07:44:38 -0700
Subject: [PATCH 2/3] closein-tests: silence compiler warning

* tests/test-closein.c (main): Ignore fread result.
* modules/closein-tests (Depends-on): Add ignore-value.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog             |    4 ++++
 modules/closein-tests |    1 +
 tests/test-closein.c  |    3 ++-
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b3c6f3f..a812234 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-02-01  Eric Blake  <address@hidden>

+       closein-tests: silence compiler warning
+       * tests/test-closein.c (main): Ignore fread result.
+       * modules/closein-tests (Depends-on): Add ignore-value.
+
        tests: silence warning about system return
        * tests/test-areadlink-with-size.c (main): Ignore system result.
        * tests/test-areadlink.c (main): Likewise.
diff --git a/modules/closein-tests b/modules/closein-tests
index 5c2126e..2f3f689 100644
--- a/modules/closein-tests
+++ b/modules/closein-tests
@@ -4,6 +4,7 @@ tests/test-closein.c

 Depends-on:
 binary-io
+ignore-value

 configure.ac:

diff --git a/tests/test-closein.c b/tests/test-closein.c
index bde436e..6b99b18 100644
--- a/tests/test-closein.c
+++ b/tests/test-closein.c
@@ -26,6 +26,7 @@
 #include <unistd.h>

 #include "binary-io.h"
+#include "ignore-value.h"

 char *program_name;

@@ -47,6 +48,6 @@ main (int argc, char **argv)
     close (0);

   if (argc > 1)
-    fread (buf, 1, 6, stdin);
+    ignore_value (fread (buf, 1, 6, stdin));
   return 0;
 }
-- 
1.6.4.2


From 6daa2ccb759752504464313949915f67869e0f8e Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sat, 30 Jan 2010 08:51:59 -0700
Subject: [PATCH 3/3] sys_time: use link-warning

Modernize replacement header, to allow another GNULIB_POSIXCHECK
opportunity.

* m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Split defaults...
(gl_HEADER_SYS_TIME_H_DEFAULTS): ...into new macro.
(gl_SYS_TIME_MODULE_INDICATOR): New macro.
* modules/sys_time (Depends-on): Add warn-on-use.
(Makefile.am): Always build replacement.
(configure.ac): Update substitutions.
* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY)
(gl_FUNC_GETTIMEOFDAY_CLOBBER): Include defaults, and no longer
bother with SYS_TIME_H.
* modules/gettimeofday (configure.ac): Declare indicator.
* lib/sys_time.in.h (gettimeofday): Warn if gnulib module is not
in use.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog            |   14 ++++++++++++++
 lib/sys_time.in.h    |   16 +++++++++++++---
 m4/gettimeofday.m4   |    5 ++---
 m4/sys_time_h.m4     |   35 ++++++++++++++++++-----------------
 modules/gettimeofday |    1 +
 modules/sys_time     |    9 ++++++---
 6 files changed, 54 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a812234..b89d127 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2010-02-01  Eric Blake  <address@hidden>

+       sys_time: use link-warning
+       * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Split defaults...
+       (gl_HEADER_SYS_TIME_H_DEFAULTS): ...into new macro.
+       (gl_SYS_TIME_MODULE_INDICATOR): New macro.
+       * modules/sys_time (Depends-on): Add warn-on-use.
+       (Makefile.am): Always build replacement.
+       (configure.ac): Update substitutions.
+       * m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY)
+       (gl_FUNC_GETTIMEOFDAY_CLOBBER): Include defaults, and no longer
+       bother with SYS_TIME_H.
+       * modules/gettimeofday (configure.ac): Declare indicator.
+       * lib/sys_time.in.h (gettimeofday): Warn if gnulib module is not
+       in use.
+
        closein-tests: silence compiler warning
        * tests/test-closein.c (main): Ignore fread result.
        * modules/closein-tests (Depends-on): Add ignore-value.
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index 442cae3..12f0860 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -41,6 +41,8 @@

 /* The definition of _GL_ARG_NONNULL is copied here.  */

+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -53,11 +55,19 @@ struct timeval
 };
 # endif

-# if @REPLACE_GETTIMEOFDAY@
-#  undef gettimeofday
-#  define gettimeofday rpl_gettimeofday
+# if @GNULIB_GETTIMEOFDAY@
+#  if @REPLACE_GETTIMEOFDAY@
+#   undef gettimeofday
+#   define gettimeofday rpl_gettimeofday
 extern int gettimeofday (struct timeval *restrict, void *restrict)
      _GL_ARG_NONNULL ((1));
+#  endif
+# elif defined GNULIB_POSIXCHECK
+#  undef gettimeofday
+#  if HAVE_RAW_DECL_GETTIMEOFDAY
+_GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
+                "use gnulib module gettimeofday for portability");
+#  endif
 # endif

 #ifdef __cplusplus
diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4
index 735123e..2155627 100644
--- a/m4/gettimeofday.m4
+++ b/m4/gettimeofday.m4
@@ -1,4 +1,4 @@
-# serial 12
+# serial 13

 # Copyright (C) 2001-2003, 2005, 2007, 2009-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([gl_HEADER_SYS_TIME_H])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
   AC_CHECK_FUNCS_ONCE([gettimeofday])

   AC_CACHE_CHECK([for gettimeofday with POSIX signature],
@@ -32,7 +33,6 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY],

   if test $gl_cv_func_gettimeofday_posix_signature != yes; then
     REPLACE_GETTIMEOFDAY=1
-    SYS_TIME_H=sys/time.h
     if test $gl_cv_func_gettimeofday_clobber != yes; then
       AC_LIBOBJ([gettimeofday])
       gl_PREREQ_GETTIMEOFDAY
@@ -78,7 +78,6 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],

  if test $gl_cv_func_gettimeofday_clobber = yes; then
    REPLACE_GETTIMEOFDAY=1
-   SYS_TIME_H=sys/time.h
    gl_GETTIMEOFDAY_REPLACE_LOCALTIME
    AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
      [Define if gettimeofday clobbers the localtime buffer.])
diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4
index 9c16487..b4c1e0d 100644
--- a/m4/sys_time_h.m4
+++ b/m4/sys_time_h.m4
@@ -1,5 +1,5 @@
 # Configure a replacement for <sys/time.h>.
-# serial 2
+# serial 3

 # Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -19,15 +19,13 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H],
 AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
 [
   AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
   AC_CHECK_HEADERS_ONCE([sys/time.h])
   gl_CHECK_NEXT_HEADERS([sys/time.h])

-  if test $ac_cv_header_sys_time_h = yes; then
-    HAVE_SYS_TIME_H=1
-  else
+  if test $ac_cv_header_sys_time_h != yes; then
     HAVE_SYS_TIME_H=0
   fi
-  AC_SUBST([HAVE_SYS_TIME_H])

   AC_CACHE_CHECK([for struct timeval], [gl_cv_sys_struct_timeval],
     [AC_COMPILE_IFELSE(
@@ -40,20 +38,23 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
           [[static struct timeval x; x.tv_sec = x.tv_usec;]])],
        [gl_cv_sys_struct_timeval=yes],
        [gl_cv_sys_struct_timeval=no])])
-  if test $gl_cv_sys_struct_timeval = yes; then
-    HAVE_STRUCT_TIMEVAL=1
-  else
+  if test $gl_cv_sys_struct_timeval != yes; then
     HAVE_STRUCT_TIMEVAL=0
   fi
-  AC_SUBST([HAVE_STRUCT_TIMEVAL])
+])
+
+AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  
GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])

+AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
+[
+  GNULIB_GETTIMEOFDAY=0;     AC_SUBST([GNULIB_GETTIMEOFDAY])
   dnl Assume POSIX behavior unless another module says otherwise.
-  REPLACE_GETTIMEOFDAY=0
-  AC_SUBST([REPLACE_GETTIMEOFDAY])
-  if test $HAVE_SYS_TIME_H = 0 || test $HAVE_STRUCT_TIMEVAL = 0; then
-    SYS_TIME_H=sys/time.h
-  else
-    SYS_TIME_H=
-  fi
-  AC_SUBST([SYS_TIME_H])
+  HAVE_STRUCT_TIMEVAL=1;     AC_SUBST([HAVE_STRUCT_TIMEVAL])
+  HAVE_SYS_TIME_H=1;         AC_SUBST([HAVE_SYS_TIME_H])
+  REPLACE_GETTIMEOFDAY=0;    AC_SUBST([REPLACE_GETTIMEOFDAY])
 ])
diff --git a/modules/gettimeofday b/modules/gettimeofday
index 0913cf1..979f601 100644
--- a/modules/gettimeofday
+++ b/modules/gettimeofday
@@ -10,6 +10,7 @@ sys_time

 configure.ac:
 gl_FUNC_GETTIMEOFDAY
+gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])

 Makefile.am:

diff --git a/modules/sys_time b/modules/sys_time
index f0789e5..28d902e 100644
--- a/modules/sys_time
+++ b/modules/sys_time
@@ -8,17 +8,18 @@ m4/sys_time_h.m4
 Depends-on:
 include_next
 arg-nonnull
+warn-on-use

 configure.ac:
 gl_HEADER_SYS_TIME_H
 AC_PROG_MKDIR_P

 Makefile.am:
-BUILT_SOURCES += $(SYS_TIME_H)
+BUILT_SOURCES += sys/time.h

 # We need the following in order to create <sys/time.h> when the system
 # doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h $(ARG_NONNULL_H)
+sys/time.h: sys_time.in.h $(WARN_ON_USE_H) $(ARG_NONNULL_H)
        $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f address@hidden $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
@@ -26,9 +27,11 @@ sys/time.h: sys_time.in.h $(ARG_NONNULL_H)
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
              -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_time.in.h; \
        } > address@hidden && \
        mv address@hidden $@
-- 
1.6.4.2

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]