diff options
-rwxr-xr-x | ChangeLog | 5 | ||||
-rw-r--r-- | field.c | 7 |
2 files changed, 12 insertions, 0 deletions
@@ -9,6 +9,11 @@ * builtin.c (do_print_rec): Restore check before calling get_field() and add do_lint to the condition. + Unrelated: + + * field.c (set_NF): Add lint warning if decrementing NF, which + doesn't work on older Unix awks. + 2018-09-16 gettextize <bug-gnu-gettext@gnu.org> * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.8. @@ -396,6 +396,13 @@ set_NF() nf = get_number_si(NF_node->var_value); if (nf < 0) fatal(_("NF set to negative value")); + + static bool warned = false; + if (do_lint && NF > nf && ! warned) { + warned = true; + lintwarn(_("decrementing NF is not portable to many awk versions")); + } + NF = nf; if (NF > nf_high_water) |