From: Jim Meyering Date: Sun, 22 Nov 2009 08:01:07 +0000 (+0100) Subject: diffseq: avoid spurious gcc warnings X-Git-Tag: v0.1~5153 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=32be9f34696c86446768d8728667ee0564832d81;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 04b2a6b7f..9f8d4efbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-22 Jim Meyering + + 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. + 2009-11-21 Jim Meyering c-stack: avoid "ignoring return value of `write'" warning diff --git a/lib/diffseq.h b/lib/diffseq.h index 0c1723f43..9c7baa6f9 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);