Mercurial > hg > octave-lyh > gnulib-hg
changeset 12334:911f28ebb9c4
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.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Sun, 22 Nov 2009 09:01:07 +0100 |
parents | d904c3a8f14c |
children | d6110537824b |
files | ChangeLog lib/diffseq.h |
diffstat | 2 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-22 Jim Meyering <meyering@redhat.com> + + 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 <meyering@redhat.com> c-stack: avoid "ignoring return value of `write'" warning
--- 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 @@ } 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);