From f82aa0619d803ebe0dc1710edf1a3e108a4210c8 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Fri, 3 Apr 2015 11:01:17 -0400 Subject: In NEWS file, rename div to intdiv. --- ChangeLog | 4 ++++ NEWS | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0a395564..9b9b114c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-04-02 Andrew J. Schorr + + * NEWS: Rename div to intdiv. + 2015-04-02 Arnold D. Robbins 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. -- cgit v1.2.3 From e7ee504434e315852ebd449e20d72929de63cfe6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 5 Apr 2015 10:50:37 +0300 Subject: Don't install gawk extensions if --posix or --traditional. --- ChangeLog | 10 ++++++++++ awkgram.c | 14 +++++++++++--- awkgram.y | 14 +++++++++++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53f2545a..52064109 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2015-04-05 Arnold D. Robbins + + * 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 * awk.h (call_sub): Renamed from call_sub_func. diff --git a/awkgram.c b/awkgram.c index fcde2564..8313afcb 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 0b3a97c9..71ca0a84 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); } } -- cgit v1.2.3