summaryrefslogtreecommitdiff
path: root/lib/diffseq.h
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-11-22 09:01:07 +0100
committerJim Meyering <meyering@redhat.com>2009-11-22 09:02:37 +0100
commit32be9f34696c86446768d8728667ee0564832d81 (patch)
treebf52519e9a6a212092df135e22fd9aa965f07f10 /lib/diffseq.h
parentdf57f4270959d6679422896ca6f579d048777d81 (diff)
downloadgnulib-32be9f34696c86446768d8728667ee0564832d81.tar.gz
diffseq: avoid spurious gcc warnings
* lib/diffseq.h (IF_LINT2): Define. (compareseq): Use it to initialize two members of "part". This avoids two used-uninitialized warnings.
Diffstat (limited to 'lib/diffseq.h')
-rw-r--r--lib/diffseq.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/diffseq.h b/lib/diffseq.h
index 0c1723f43b..9c7baa6f95 100644
--- a/lib/diffseq.h
+++ b/lib/diffseq.h
@@ -77,6 +77,15 @@
# endif
#endif
+/* As above, but when Code must contain one comma. */
+#ifndef IF_LINT2
+# ifdef lint
+# define IF_LINT2(Code1, Code2) Code1, Code2
+# else
+# define IF_LINT2(Code1, Code2) /* empty */
+# endif
+#endif
+
/*
* Context of comparison operation.
*/
@@ -464,7 +473,7 @@ compareseq (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim,
}
else
{
- struct partition part;
+ struct partition part IF_LINT2 (= { .xmid = 0, .ymid = 0 });
/* Find a point of correspondence in the middle of the vectors. */
diag (xoff, xlim, yoff, ylim, find_minimal, &part, ctxt);