changeset 30242:86950e198e32

tests: avoid some compiler warnings * tests/test-memchr.c (main): Pass NULL indirectly. * tests/test-getdate.c (main): Remove unused variable 'ret'. Signed-off-by: Simon Josefsson <simon@josefsson.org>
author Simon Josefsson <simon@josefsson.org>
date Tue, 30 Sep 2008 08:34:56 +0200
parents 865a79492d69
children 134a4ebe4407
files ChangeLog tests/test-getdate.c tests/test-memrchr.c
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Sep 29 23:20:34 2008 +0200
+++ b/ChangeLog	Tue Sep 30 08:34:56 2008 +0200
@@ -1,3 +1,9 @@
+2008-09-15  Simon Josefsson  <simon@josefsson.org>
+
+	tests: avoid some compiler warnings
+	* tests/test-memchr.c (main): Pass NULL indirectly.
+	* tests/test-getdate.c (main): Remove unused variable 'ret'.
+
 2008-09-29  Ondřej Vašík  <ovasik@redhat.com>
 
 	getdate.y: disallow countable dayshifts like "4 yesterday ago"
--- a/tests/test-getdate.c	Mon Sep 29 23:20:34 2008 +0200
+++ b/tests/test-getdate.c	Tue Sep 30 08:34:56 2008 +0200
@@ -49,7 +49,6 @@
 int
 main (int argc, char **argv)
 {
-  bool ret;
   struct timespec result;
   struct timespec result2;
   struct timespec now;
--- a/tests/test-memrchr.c	Mon Sep 29 23:20:34 2008 +0200
+++ b/tests/test-memrchr.c	Tue Sep 30 08:34:56 2008 +0200
@@ -41,6 +41,8 @@
 int
 main ()
 {
+  void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings.  */
+
   size_t n = 0x100000;
   char *input = malloc (n);
   ASSERT (input);
@@ -56,7 +58,7 @@
   ASSERT (MEMRCHR (input, 'a', n) == input + n - 1);
 
   ASSERT (MEMRCHR (input, 'a', 0) == NULL);
-  ASSERT (MEMRCHR (NULL, 'a', 0) == NULL);
+  ASSERT (MEMRCHR (nil, 'a', 0) == NULL);
 
   ASSERT (MEMRCHR (input, 'b', n) == input + n - 2);
   ASSERT (MEMRCHR (input, 'c', n) == input + n - 3);