[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-738
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-738-g0e54ab8 |
Date: |
Sat, 26 Sep 2015 20:21:34 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-4.1-stable has been updated
via 0e54ab845160a222556047482ea02f7221f34e59 (commit)
from 3e762b6f62061974d152dd251f3e83cacca073e3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0e54ab845160a222556047482ea02f7221f34e59
commit 0e54ab845160a222556047482ea02f7221f34e59
Author: Arnold D. Robbins <address@hidden>
Date: Sat Sep 26 23:20:53 2015 +0300
Fatal with --posix on multidimensional arrays.
diff --git a/ChangeLog b/ChangeLog
index caccdef..ac4f78d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-26 Arnold D. Robbins <address@hidden>
+
+ * awkgram.y (yylex): Diagnose multidimensional arrays for
+ traditional/posix (fatal) or lint. Thanks to Ed Morton
+ for the bug report.
+
2015-09-25 Arnold D. Robbins <address@hidden>
* config.guess, config.sub, config.rpath: Updated.
diff --git a/awkgram.c b/awkgram.c
index fa88a50..728bc29 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -5563,6 +5563,10 @@ retry:
c = nextc(true);
pushback();
if (c == '[') {
+ if (do_traditional)
+ fatal(_("multidimensional arrays are a gawk
extension"));
+ if (do_lint)
+ lintwarn(_("multidimensional arrays are a gawk
extension"));
yylval = GET_INSTRUCTION(Op_sub_array);
lasttok = ']';
} else {
diff --git a/awkgram.y b/awkgram.y
index f311f29..0da7fbe 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3224,6 +3224,10 @@ retry:
c = nextc(true);
pushback();
if (c == '[') {
+ if (do_traditional)
+ fatal(_("multidimensional arrays are a gawk
extension"));
+ if (do_lint)
+ lintwarn(_("multidimensional arrays are a gawk
extension"));
yylval = GET_INSTRUCTION(Op_sub_array);
lasttok = ']';
} else {
diff --git a/test/ChangeLog b/test/ChangeLog
index 10bccd5..8a22723 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-26 Arnold D. Robbins <address@hidden>
+
+ * Makefile.am (muldimposix): New test.
+ * muldimposix.awk, muldimposix.ok: New files.
+
2015-09-18 Arnold D. Robbins <address@hidden>
* Makefile.am (fpat5): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index 6996b1c..27ccb76 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -509,6 +509,8 @@ EXTRA_DIST = \
manglprm.ok \
manyfiles.awk \
manyfiles.ok \
+ muldimposix.awk \
+ muldimposix.ok \
match1.awk \
match1.ok \
match2.awk \
@@ -1069,6 +1071,7 @@ GAWK_EXT_TESTS = \
include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 mbstr2 \
+ muldimposix \
nastyparm negtime next nondec nondec2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge
procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7
pty1 \
@@ -2088,6 +2091,11 @@ negtime::
@TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
@AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk
"$(srcdir)"/address@hidden _$@ && rm -f _$@
+muldimposix::
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden --posix >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
# Targets generated for other tests:
include Maketests
diff --git a/test/Makefile.in b/test/Makefile.in
index ba5da05..787fba1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -766,6 +766,8 @@ EXTRA_DIST = \
manglprm.ok \
manyfiles.awk \
manyfiles.ok \
+ muldimposix.awk \
+ muldimposix.ok \
match1.awk \
match1.ok \
match2.awk \
@@ -1325,6 +1327,7 @@ GAWK_EXT_TESTS = \
include include2 indirectbuiltin indirectcall indirectcall2 \
lint lintold lintwarn \
manyfiles match1 match2 match3 mbstr1 mbstr2 \
+ muldimposix \
nastyparm negtime next nondec nondec2 \
patsplit posix printfbad1 printfbad2 printfbad3 printfbad4 printhuge
procinfs \
profile0 profile1 profile2 profile3 profile4 profile5 profile6 profile7
pty1 \
@@ -2524,6 +2527,11 @@ negtime::
@echo $@
@TZ=GMT AWKPATH="$(srcdir)" $(AWK) -f address@hidden >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
@AWKPATH="$(srcdir)" $(AWK) -f checknegtime.awk
"$(srcdir)"/address@hidden _$@ && rm -f _$@
+
+muldimposix::
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f address@hidden --posix >_$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
diff --git a/test/muldimposix.awk b/test/muldimposix.awk
new file mode 100644
index 0000000..135b324
--- /dev/null
+++ b/test/muldimposix.awk
@@ -0,0 +1 @@
+BEGIN { a[1][2] = 3 }
diff --git a/test/muldimposix.ok b/test/muldimposix.ok
new file mode 100644
index 0000000..3594fab
--- /dev/null
+++ b/test/muldimposix.ok
@@ -0,0 +1,2 @@
+gawk: muldimposix.awk:1: fatal: multidimensional arrays are a gawk extension
+EXIT CODE: 2
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
awkgram.c | 4 ++++
awkgram.y | 4 ++++
test/ChangeLog | 5 +++++
test/Makefile.am | 8 ++++++++
test/Makefile.in | 8 ++++++++
test/muldimposix.awk | 1 +
test/muldimposix.ok | 2 ++
8 files changed, 38 insertions(+), 0 deletions(-)
create mode 100644 test/muldimposix.awk
create mode 100644 test/muldimposix.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-738-g0e54ab8,
Arnold Robbins <=