aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.y
diff options
context:
space:
mode:
Diffstat (limited to 'awkgram.y')
-rw-r--r--awkgram.y7
1 files changed, 7 insertions, 0 deletions
diff --git a/awkgram.y b/awkgram.y
index cdaab6cb..b1574c88 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -47,7 +47,9 @@ static int install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist);
static NODE *mk_rexp(INSTRUCTION *exp);
static void param_sanity(INSTRUCTION *arglist);
static int parms_shadow(INSTRUCTION *pc, int *shadow);
+#ifndef NO_LINT
static int isnoeffect(OPCODE type);
+#endif
static INSTRUCTION *make_assignable(INSTRUCTION *ip);
static void dumpintlstr(const char *str, size_t len);
static void dumpintlstr2(const char *str1, size_t len1, const char *str2, size_t len2);
@@ -4514,6 +4516,7 @@ mk_rexp(INSTRUCTION *list)
return ip->memory;
}
+#ifndef NO_LINT
/* isnoeffect --- when used as a statement, has no side effects */
static int
@@ -4556,6 +4559,8 @@ isnoeffect(OPCODE type)
return false;
}
+#endif /* NO_LINT */
+
/* make_assignable --- make this operand an assignable one if posiible */
@@ -5354,8 +5359,10 @@ add_lint(INSTRUCTION *list, LINTTYPE linttype)
;
if (do_lint) { /* compile-time warning */
+#ifndef NO_LINT
if (isnoeffect(ip->opcode))
lintwarn_ln(ip->source_line, ("statement may have no effect"));
+#endif
}
if (ip->opcode == Op_push) { /* run-time warning */