From caad0e21819d14c8bdf0cf7cd75f275f0aa08876 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii <eliz@gnu.org>
Date: Sat, 24 Sep 2022 21:15:41 +0300
Subject: [PATCH] Avoid compilation warnings

* src/implicit.c: (pattern_search):
* src/main.c: (main): Avoid compilation warnings for variables
only used when compiling a debug version with assertions.
---
 src/implicit.c | 2 ++
 src/main.c     | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/implicit.c b/src/implicit.c
index a9c763a6..bef70063 100644
--- a/src/implicit.c
+++ b/src/implicit.c
@@ -234,7 +234,9 @@ pattern_search (struct file *file, int archive,
      We may replace % by $(*F) for second expansion, increasing the length.  */
   size_t deplen = namelen + max_pattern_dep_length + 4;
   char *depname = alloca (deplen);
+#ifndef NDEBUG
   char *dend = depname + deplen;
+#endif
 
   /* The start and length of the stem of FILENAME for the current rule.  */
   const char *stem = 0;
diff --git a/src/main.c b/src/main.c
index 7392a432..3821089c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2558,13 +2558,11 @@ main (int argc, char **argv, char **envp)
 
               for (; *av; ++av, ++nv)
                 {
-                  size_t len;
                   char *f;
                   char *a = *av;
                   const char *mf = makefiles->list[mfidx];
 
-                  len = strlen (a);
-                  assert (len > 0);
+                  assert (strlen (a) > 0);
 
                   *nv = a;