gawk-diffs
[Top][All Lists]
Advanced

[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-629


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-629-ge7ee504
Date: Sun, 05 Apr 2015 07:51:01 +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  e7ee504434e315852ebd449e20d72929de63cfe6 (commit)
      from  9730efeabb2116fdf7e93b4553825ba147f5f523 (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=e7ee504434e315852ebd449e20d72929de63cfe6

commit e7ee504434e315852ebd449e20d72929de63cfe6
Author: Arnold D. Robbins <address@hidden>
Date:   Sun Apr 5 10:50:37 2015 +0300

    Don't install gawk extensions if --posix or --traditional.

diff --git a/ChangeLog b/ChangeLog
index 53f2545..5206410 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-04-05         Arnold D. Robbins     <address@hidden>
+
+       * 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-03-31         Arnold D. Robbins     <address@hidden>
 
        * awk.h (call_sub): Renamed from call_sub_func.
diff --git a/awkgram.c b/awkgram.c
index fcde256..8313afc 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -7997,12 +7997,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 0b3a97c..71ca0a8 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -5658,12 +5658,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);
                }
        }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog |   10 ++++++++++
 awkgram.c |   14 +++++++++++---
 awkgram.y |   14 +++++++++++---
 3 files changed, 32 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]