bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] tests: silence clang warning


From: Eric Blake
Subject: [PATCH] tests: silence clang warning
Date: Mon, 30 Aug 2010 15:45:03 -0600

* tests/test-malloca.c (do_allocation): Avoid dead store.

Signed-off-by: Eric Blake <address@hidden>
---

I ran clang on m4, and found a couple of warnings.  It warned
about this as a dead store, and it's easy enough to avoid.

Clang also warned about some potential null dereferences in
gl_avltree_oset.c; but I think it was missing on some additional
constraints (namely, the incoming height_diff must be exactly
-1 or 1, and each node->balance must be in the range [-1..1];
and that the balance also has some implications as to whether
the left or right child must exist), so I'm chalking those
up as spurious warnings (but I don't know how to silence
clang other than to slow down the code by adding cruft like:
if (unlikely(!node->right)) abort();

 ChangeLog            |    5 +++++
 tests/test-malloca.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8262bce..45bd20f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-30  Eric Blake  <address@hidden>
+
+       tests: silence clang warning
+       * tests/test-malloca.c (do_allocation): Avoid dead store.
+
 2010-08-29  Bruno Haible  <address@hidden>

        gettext: Fix recent mistake.
diff --git a/tests/test-malloca.c b/tests/test-malloca.c
index 14ef3a9..8cf4d0d 100644
--- a/tests/test-malloca.c
+++ b/tests/test-malloca.c
@@ -27,7 +27,7 @@ do_allocation (int n)
 {
   void *ptr = malloca (n);
   freea (ptr);
-  ptr = safe_alloca (n);
+  safe_alloca (n);
 }

 void (*func) (int) = do_allocation;
-- 
1.7.2.2




reply via email to

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