From: Eli Zaretskii Date: Sat, 24 Sep 2022 18:15:41 +0000 (+0300) Subject: Avoid compilation warnings X-Git-Tag: 4.3.91~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=caad0e21819d14c8bdf0cf7cd75f275f0aa08876;p=thirdparty%2Fmake.git 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. --- 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;