commit ae19da0
shrub
·
2026-07-05 22:59:05 +0000 UTC
parent aa0aab8
remove extraenous warnings (should make linter mode for things like this?)
1 files changed,
+0,
-36
+0,
-36
1@@ -115,14 +115,6 @@ haskw(const char *s, const char *kw)
2 return s[n] == 0 || isspace((unsigned char)s[n]);
3 }
4
5-static int
6-iscondkw(const char *s)
7-{
8- return haskw(s, "ifeq") || haskw(s, "ifneq") ||
9- haskw(s, "ifdef") || haskw(s, "ifndef") ||
10- haskw(s, "else") || haskw(s, "endif");
11-}
12-
13 static int
14 hasws(const char *s)
15 {
16@@ -1243,34 +1235,6 @@ parseblock(const struct Pre *pre, size_t *i, struct NodeList *out, struct Node *
17 char *trim;
18
19 line = &pre->v[*i];
20- if (line->isrecipe) {
21- char *rt;
22- const char *tabwarn;
23-
24- rt = trimdup(line->text + 1, strlen(line->text + 1));
25- tabwarn = 0;
26- if (iscondkw(rt)) {
27- tabwarn = "conditional directive lines cannot start with TAB";
28- } else if (haskw(rt, "-include")) {
29- tabwarn = "-include lines cannot start with TAB";
30- } else if (haskw(rt, "sinclude")) {
31- tabwarn = "sinclude lines cannot start with TAB";
32- } else if (haskw(rt, "include")) {
33- tabwarn = "include lines cannot start with TAB";
34- } else if (haskw(rt, "override") || haskw(rt, "export") ||
35- haskw(rt, "unexport") || haskw(rt, "define") ||
36- haskw(rt, "endef") || haskw(rt, "undefine") ||
37- haskw(rt, "vpath") || haskw(rt, "private") ||
38- haskw(rt, "load")) {
39- tabwarn = "directive lines cannot start with TAB";
40- }
41- free(rt);
42- if (tabwarn) {
43- warnlikemake(line->path, line->line0, tabwarn);
44- memmove(line->text, line->text + 1, strlen(line->text + 1) + 1);
45- line->isrecipe = 0;
46- }
47- }
48 if (line->isrecipe) {
49 if (last_rule) {
50 if (!ruleinlist(out, last_rule))