aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-05 10:53:40 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-05 10:53:40 +0300
commit7f26aba2472025b18af917705d9c923bfc76d337 (patch)
treebaf891c4c4dba04c94be0d30e67f072b896c11f8
parent91ac42ccd9bbeee4f17181cd896cc9b7de13b6f7 (diff)
parentdbf9d5a4fc4b6d6340912395f020019576ed37f6 (diff)
downloadegawk-7f26aba2472025b18af917705d9c923bfc76d337.tar.gz
egawk-7f26aba2472025b18af917705d9c923bfc76d337.tar.bz2
egawk-7f26aba2472025b18af917705d9c923bfc76d337.zip
Merge branch 'master' into wasted-byte
-rw-r--r--ChangeLog14
-rw-r--r--NEWS2
-rw-r--r--awkgram.c14
-rw-r--r--awkgram.y14
4 files changed, 37 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 79e0f1fb..bdb9ace0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2015-04-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (install_builtins): If do_traditional is true, do not
+ install gawk extensions flagged with GAWKX. Similarly, if do_posix
+ is true, do not install functions flagged with NOT_POSIX.
+ This fixes a problem with spurious lint complaints about shadowing
+ a global variable that is not valid in traditional or posix mode.
+ Thanks to Andrew Schorr for finding the problem and supplying
+ initial code; I did it slightly differently.
+
+2015-04-02 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * NEWS: Rename div to intdiv.
+
2015-04-02 Arnold D. Robbins <arnold@skeeve.com>
Rename div() to intdiv().
diff --git a/NEWS b/NEWS
index 0c27c2c0..d3c1b055 100644
--- a/NEWS
+++ b/NEWS
@@ -23,7 +23,7 @@ Changes from 4.1.x to 4.2.0
4. The igawk script and igawk.1 man page are no longer installed by
`make install'. They have been obsolete since gawk 4.0.0.
-5. Gawk now has a `div()' function to perform integer division; this is
+5. Gawk now has a `intdiv()' function to perform integer division; this is
primarily useful for the -M option to avoid MPFR division when all
values involved are integers.
diff --git a/awkgram.c b/awkgram.c
index 02c6e41b..9f96db0b 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -8234,12 +8234,20 @@ void
install_builtins(void)
{
int i, j;
+ int flags_that_must_be_clear = DEBUG_USE;
+
+ if (do_traditional)
+ flags_that_must_be_clear |= GAWKX;
+
+ if (do_posix)
+ flags_that_must_be_clear |= NOT_POSIX;
+
j = sizeof(tokentab) / sizeof(tokentab[0]);
for (i = 0; i < j; i++) {
- if ( (tokentab[i].class == LEX_BUILTIN
- || tokentab[i].class == LEX_LENGTH)
- && (tokentab[i].flags & DEBUG_USE) == 0) {
+ if ( (tokentab[i].class == LEX_BUILTIN
+ || tokentab[i].class == LEX_LENGTH)
+ && (tokentab[i].flags & flags_that_must_be_clear) == 0) {
(void) install_symbol(tokentab[i].operator, Node_builtin_func);
}
}
diff --git a/awkgram.y b/awkgram.y
index d723f510..077ff793 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -5896,12 +5896,20 @@ void
install_builtins(void)
{
int i, j;
+ int flags_that_must_be_clear = DEBUG_USE;
+
+ if (do_traditional)
+ flags_that_must_be_clear |= GAWKX;
+
+ if (do_posix)
+ flags_that_must_be_clear |= NOT_POSIX;
+
j = sizeof(tokentab) / sizeof(tokentab[0]);
for (i = 0; i < j; i++) {
- if ( (tokentab[i].class == LEX_BUILTIN
- || tokentab[i].class == LEX_LENGTH)
- && (tokentab[i].flags & DEBUG_USE) == 0) {
+ if ( (tokentab[i].class == LEX_BUILTIN
+ || tokentab[i].class == LEX_LENGTH)
+ && (tokentab[i].flags & flags_that_must_be_clear) == 0) {
(void) install_symbol(tokentab[i].operator, Node_builtin_func);
}
}