aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-09-26 16:26:25 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-09-26 16:26:25 +0300
commitc25c88f583c984112055fa091d357c1b8538d5d8 (patch)
treea971b8150c89a3f00e816c14bfc6cacb2f96c1d4 /awk.h
parent26b1a15e75cc1d134e8b52b0df9a5d1365e66d8f (diff)
downloadegawk-c25c88f583c984112055fa091d357c1b8538d5d8.tar.gz
egawk-c25c88f583c984112055fa091d357c1b8538d5d8.tar.bz2
egawk-c25c88f583c984112055fa091d357c1b8538d5d8.zip
Add more lint warnings.
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/awk.h b/awk.h
index 4de6cfc8..e3f458b2 100644
--- a/awk.h
+++ b/awk.h
@@ -1771,9 +1771,15 @@ extern uintmax_t adjust_uint(uintmax_t n);
/* POP_ARRAY --- get the array at the top of the stack */
static inline NODE *
-POP_ARRAY()
+POP_ARRAY(bool check_for_untyped)
{
NODE *t = POP();
+ static bool warned = false;
+
+ if (do_lint && ! warned && check_for_untyped && t->type == Node_var_new) {
+ warned = true;
+ lintwarn(_("behavior of `for' loop on untyped variable is not defined by POSIX"));
+ }
return (t->type == Node_var_array) ? t : force_array(t, true);
}