bug-gnulib
[Top][All Lists]
Advanced

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

Re: diffseq: Silence gcc warning


From: Bruno Haible
Subject: Re: diffseq: Silence gcc warning
Date: Fri, 26 May 2023 21:38:19 +0200

> 2023-05-26  Bruno Haible  <bruno@clisp.org>
> 
>       diffseq: Silence gcc warning.
>       * lib/diffseq.h: Add #pragma GCC diagnostic.

Oops, this patch was not sufficient. With gcc 13.1.0 I see this warning:

diffseq.h:561:20: warning: 'part.xmid' may be used uninitialized 
[-Wmaybe-uninitialized]

This patch fixes it.


2023-05-26  Bruno Haible  <bruno@clisp.org>

        diffseq: Silence another gcc warning.
        * lib/diffseq.h (compareseq): Move into the scope of the '#pragma GCC
        diagnostic'.

diff --git a/lib/diffseq.h b/lib/diffseq.h
index bab8256f64..06e1465bf1 100644
--- a/lib/diffseq.h
+++ b/lib/diffseq.h
@@ -450,10 +450,6 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, 
bool find_minimal,
   #undef XREF_YREF_EQUAL
 }
 
-#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
-# pragma GCC diagnostic pop
-#endif
-
 
 /* Compare in detail contiguous subsequences of the two vectors
    which are known, as a whole, to match each other.
@@ -572,6 +568,10 @@ compareseq (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET 
ylim,
   #undef XREF_YREF_EQUAL
 }
 
+#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
+# pragma GCC diagnostic pop
+#endif
+
 #undef ELEMENT
 #undef EQUAL
 #undef OFFSET






reply via email to

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