]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Avoid compilation warnings
authorEli Zaretskii <eliz@gnu.org>
Sat, 24 Sep 2022 18:15:41 +0000 (21:15 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 24 Sep 2022 18:15:41 +0000 (21:15 +0300)
* 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
src/main.c

index a9c763a696281dd3d7877b5cd9741bc38ed3aed9..bef7006391238b410382f75e3cdbac3bd55656ae 100644 (file)
@@ -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;
index 7392a432a86f01ffe6169512935b6cbabd04ccc8..3821089cbfac6f428cfb5135149e0f50a454101b 100644 (file)
@@ -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;