]> Savannah Git Hosting - gnulib.git/commitdiff
diffseq: simplify lint removal
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Aug 2023 17:04:41 +0000 (10:04 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 5 Aug 2023 17:07:34 +0000 (10:07 -0700)
* lib/diffseq.h (IF_LINT): Remove.
Instead, always ignore the diagnostic, as that’s simpler
now that we have the pragma change installed in May.
This removes the last IF_LINT from diffutils, though not
the last use of GCC_LINT.

ChangeLog
lib/diffseq.h

index a6b3a10da229a6906fdd49853391edc63f1c3940..e1437b1b41519930fbc3f17b579779c9440d706e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-08-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       diffseq: simplify lint removal
+       * lib/diffseq.h (IF_LINT): Remove.
+       Instead, always ignore the diagnostic, as that’s simpler
+       now that we have the pragma change installed in May.
+       This removes the last IF_LINT from diffutils, though not
+       the last use of GCC_LINT.
+
 2023-08-04  Bruno Haible  <bruno@clisp.org>
 
        unistr/{u8-mbtouc,u8-mbsnlen}: Fix test failures (regr. 2023-07-25).
index 06e1465bf1bee0cd74fac1fec3e5d9cbc0c21c3d..3f85ab2ec41ff19e36bd5ee3c11e218521e670c8 100644 (file)
 # define NOTE_ORDERED false
 #endif
 
-/* Use this to suppress gcc's "...may be used before initialized" warnings.
-   Beware: The Code argument must not contain commas.  */
+/* Suppress gcc's "...may be used before initialized" warnings,
+   generated by GCC versions up to at least GCC 13.2.  */
 #if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
 # pragma GCC diagnostic push
-#endif
-#ifndef IF_LINT
-# if defined GCC_LINT || defined lint
-#  define IF_LINT(Code) Code
-# else
-#  define IF_LINT(Code) /* empty */
-#  if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
-#   pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#  endif
-# endif
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #endif
 
 /*
@@ -388,13 +379,8 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
          and report halfway between our best results so far.  */
       if (c >= ctxt->too_expensive)
         {
-          OFFSET fxybest;
-          OFFSET fxbest IF_LINT (= 0);
-          OFFSET bxybest;
-          OFFSET bxbest IF_LINT (= 0);
-
           /* Find forward diagonal that maximizes X + Y.  */
-          fxybest = -1;
+          OFFSET fxybest = -1, fxbest;
           for (d = fmax; d >= fmin; d -= 2)
             {
               OFFSET x = MIN (fd[d], xlim);
@@ -412,7 +398,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
             }
 
           /* Find backward diagonal that minimizes X + Y.  */
-          bxybest = OFFSET_MAX;
+          OFFSET bxybest = OFFSET_MAX, bxbest;
           for (d = bmax; d >= bmin; d -= 2)
             {
               OFFSET x = MAX (xoff, bd[d]);