[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-297
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-2973-g58cc32a |
Date: |
Thu, 24 May 2018 11:38:22 -0400 (EDT) |
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.2-stable has been updated
via 58cc32a6d4a179b3005f8e4fecbff932da681fba (commit)
from 524c41752a1043dce23fdb7e5893ad89c0944c92 (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=58cc32a6d4a179b3005f8e4fecbff932da681fba
commit 58cc32a6d4a179b3005f8e4fecbff932da681fba
Author: Arnold D. Robbins <address@hidden>
Date: Thu May 24 18:37:48 2018 +0300
Improve lint checking for statement of just a constant.
diff --git a/ChangeLog b/ChangeLog
index 451f1c5..cfeb251 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-24 Arnold D. Robbins <address@hidden>
+
+ * awkgram.y (add_lint): For no-effect case, also check for
+ Op_push_i. Makes statements consisting of a single constant
+ trigger the warning.
+
2018-05-23 Arnold D. Robbins <address@hidden>
* config.guess, config.sub: Updated from GNULIB.
diff --git a/awkgram.c b/awkgram.c
index 13a7be7..493109f 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -8326,7 +8326,7 @@ add_lint(INSTRUCTION *list, LINTTYPE linttype)
}
}
- if (ip->opcode == Op_push) { /* run-time
warning */
+ if (ip->opcode == Op_push || ip->opcode == Op_push_i) {
/* run-time warning */
list_append(list, instruction(Op_lint));
list->lasti->lint_type = linttype;
}
diff --git a/awkgram.y b/awkgram.y
index e1c75e9..bc8b4a6 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -5906,7 +5906,7 @@ add_lint(INSTRUCTION *list, LINTTYPE linttype)
}
}
- if (ip->opcode == Op_push) { /* run-time
warning */
+ if (ip->opcode == Op_push || ip->opcode == Op_push_i) {
/* run-time warning */
list_append(list, instruction(Op_lint));
list->lasti->lint_type = linttype;
}
diff --git a/test/ChangeLog b/test/ChangeLog
index 3f22e1c..a257520 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-24 Arnold D. Robbins <address@hidden>
+
+ * noeffect.awk, noeffect.ok: Updated.
+
2018-05-23 Arnold D. Robbins <address@hidden>
* Makefile.am (EXTRA_DIST): Add files for spacere.
diff --git a/test/noeffect.awk b/test/noeffect.awk
index 472c408..4be76b1 100644
--- a/test/noeffect.awk
+++ b/test/noeffect.awk
@@ -3,4 +3,8 @@ BEGIN {
s + 1
;;
"s" 1
+ "a"
+ 42
+ q = 42
+ q
}
diff --git a/test/noeffect.ok b/test/noeffect.ok
index 6a0cc75..9778a4b 100644
--- a/test/noeffect.ok
+++ b/test/noeffect.ok
@@ -3,3 +3,6 @@ gawk: noeffect.awk:3: warning: statement may have no effect
gawk: noeffect.awk:5: warning: statement may have no effect
gawk: noeffect.awk:2: warning: reference to uninitialized variable `s'
gawk: noeffect.awk:3: warning: reference to uninitialized variable `s'
+gawk: noeffect.awk:6: warning: statement has no effect
+gawk: noeffect.awk:7: warning: statement has no effect
+gawk: noeffect.awk:9: warning: statement has no effect
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
awkgram.c | 2 +-
awkgram.y | 2 +-
test/ChangeLog | 4 ++++
test/noeffect.awk | 4 ++++
test/noeffect.ok | 3 +++
6 files changed, 19 insertions(+), 2 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-2973-g58cc32a,
Arnold Robbins <=