aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-09-26 16:27:43 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-09-26 16:27:43 +0300
commitb31e1e36d785413939ff46380b9387789054de8b (patch)
treea9db5199fe30bf71882328dd9432ccb14472f59a /awk.h
parent450251f1adca89a83c7f472b8318baba67a543d4 (diff)
parent8c5752ed884408c41609d3ae471c04afaf1fb40a (diff)
downloadegawk-b31e1e36d785413939ff46380b9387789054de8b.tar.gz
egawk-b31e1e36d785413939ff46380b9387789054de8b.tar.bz2
egawk-b31e1e36d785413939ff46380b9387789054de8b.zip
Merge branch 'master' into feature/fix-comments
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 d413274c..0a34c258 100644
--- a/awk.h
+++ b/awk.h
@@ -1762,9 +1762,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);
}