summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-01-01 16:04:16 +0600
committerMattias Andrée <maandree@kth.se>2022-01-01 11:32:49 +0100
commitb64fd2a395f99a7d7fc64a277237a8be71b05ffd (patch)
treedcbac27f93fd90e82563adb10dc9d23c4b5c1494
parentRename to mklint to avoid confusion with pre-existing tool with opposite goal (diff)
downloadmakel-b64fd2a395f99a7d7fc64a277237a8be71b05ffd.tar.gz
makel-b64fd2a395f99a7d7fc64a277237a8be71b05ffd.tar.bz2
makel-b64fd2a395f99a7d7fc64a277237a8be71b05ffd.tar.xz
improve WC_EXTRA_MAKEFILE warning
currently if open_default_makefile() finds a standard makefile it will print info message but then warn about the same file being "additional." [nrk mklint master]% ./mklint ./mklint: [info] found standard makefile to use: Makefile (-wmakefile) ./mklint: [warn] found additional standard makefile: Makefile (-wextra-makefile) this makes it so that it doesn't produce warning about the the makefile that it already found as "additional." also declares the default_makefiles pointer as const for good measures.
-rw-r--r--mklint.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mklint.c b/mklint.c
index aec636e..1c17eea 100644
--- a/mklint.c
+++ b/mklint.c
@@ -7,7 +7,7 @@ NUSAGE(EXIT_ERROR, "[-f makefile]");
int exit_status = 0;
-static const char *default_makefiles[] = {
+static const char *const default_makefiles[] = {
"makefile",
"Makefile"
};
@@ -41,9 +41,10 @@ open_default_makefile(const char **pathp)
"alternatives are ./makefile and ./Makefile");
find_existing_fallbacks:
- for (; i < ELEMSOF(default_makefiles); i++)
+ for (i++; i < ELEMSOF(default_makefiles); i++)
if (!access(default_makefiles[i], F_OK))
- warnf_warning(WC_EXTRA_MAKEFILE, "found additional standard makefile: %s", *pathp);
+ warnf_warning(WC_EXTRA_MAKEFILE, "found additional standard makefile: %s",
+ default_makefiles[i]);
return fd;
}