aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-12-07 14:33:48 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-12-07 14:33:48 +0200
commitf634938f90ef8c85cfd9ca7421f10f4b70c0137e (patch)
treebaaf1167db893a04b774c5ba71a2b51ecd9686c9
parent32323fa42c2c9079abf9a5fe92b2af8c523fd84b (diff)
parentd20af67ae8a6a573a0db906f9c9960a092f21b41 (diff)
downloadegawk-f634938f90ef8c85cfd9ca7421f10f4b70c0137e.tar.gz
egawk-f634938f90ef8c85cfd9ca7421f10f4b70c0137e.tar.bz2
egawk-f634938f90ef8c85cfd9ca7421f10f4b70c0137e.zip
Merge branch 'gawk-4.0-stable'. fflush is now POSIX.
-rw-r--r--ChangeLog14
-rw-r--r--NEWS7
-rw-r--r--awkgram.c12
-rw-r--r--awkgram.y12
-rw-r--r--doc/ChangeLog6
-rw-r--r--doc/awkcard.in5
-rw-r--r--doc/gawk.114
-rw-r--r--doc/gawk.info636
-rw-r--r--doc/gawk.texi32
9 files changed, 370 insertions, 368 deletions
diff --git a/ChangeLog b/ChangeLog
index c87c1cce..edcd7706 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-12-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (tokentab): `fflush()' is now in POSIX, remove the
+ RESX flag. This was the last use, so delete the flag.
+ (yylex): Don't check RESX.
+
+ Thanks to Nathan Weeks <weeks@iastate.edu> for helping make this
+ happen.
+
2012-12-01 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h: For op_assign_concat, if both strings
@@ -121,6 +130,11 @@
* gawkapi.h: Minor documentation edits.
+2012-11-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_fflush): Make fflush() and fflush("") both
+ flush everything. See the comment in the code.
+
2012-10-28 Arnold D. Robbins <arnold@skeeve.com>
* Update to bison 2.6.4. Various files regenerated.
diff --git a/NEWS b/NEWS
index bc0e147e..b9b8e6ba 100644
--- a/NEWS
+++ b/NEWS
@@ -36,7 +36,12 @@ Changes from 4.0.1 to 4.0.2
1. Infrastructure upgrades: Autoconf 2.69, Automake 1.12.4, bison 2.6.5.
-2. Various minor bug fixes and documentation updates.
+2. `fflush()', `nextfile', and `delete array' are all now part of POSIX.
+
+3. fflush() behavior changed to match BWK awk and for POSIX - now both
+ fflush() and fflush("") flush all open output redirections.
+
+4. Various minor bug fixes and documentation updates.
Changes from 4.0.0 to 4.0.1
---------------------------
diff --git a/awkgram.c b/awkgram.c
index 324ba1e3..54680e75 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4328,9 +4328,8 @@ struct token {
# define NOT_OLD 0x0100 /* feature not in old awk */
# define NOT_POSIX 0x0200 /* feature not in POSIX */
# define GAWKX 0x0400 /* gawk extension */
-# define RESX 0x0800 /* Bell Labs Research extension */
-# define BREAK 0x1000 /* break allowed inside */
-# define CONTINUE 0x2000 /* continue allowed inside */
+# define BREAK 0x0800 /* break allowed inside */
+# define CONTINUE 0x1000 /* continue allowed inside */
NODE *(*ptr)(int); /* function that implements this keyword */
NODE *(*ptr2)(int); /* alternate arbitrary-precision function */
@@ -4391,7 +4390,7 @@ static const struct token tokentab[] = {
{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
{"exit", Op_K_exit, LEX_EXIT, 0, 0, 0},
{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)},
-{"fflush", Op_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush, 0},
+{"fflush", Op_builtin, LEX_BUILTIN, A(0)|A(1), do_fflush, 0},
{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0, 0},
{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0, 0},
{"function",Op_func, LEX_FUNCTION, NOT_OLD, 0, 0},
@@ -6141,11 +6140,6 @@ retry:
tokentab[mid].operator);
warntab[mid] |= GAWKX;
}
- if ((tokentab[mid].flags & RESX) && ! (warntab[mid] & RESX)) {
- lintwarn(_("`%s' is a Bell Labs extension"),
- tokentab[mid].operator);
- warntab[mid] |= RESX;
- }
if ((tokentab[mid].flags & NOT_POSIX) && ! (warntab[mid] & NOT_POSIX)) {
lintwarn(_("POSIX does not allow `%s'"),
tokentab[mid].operator);
diff --git a/awkgram.y b/awkgram.y
index e7d44b83..3048cc80 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1795,9 +1795,8 @@ struct token {
# define NOT_OLD 0x0100 /* feature not in old awk */
# define NOT_POSIX 0x0200 /* feature not in POSIX */
# define GAWKX 0x0400 /* gawk extension */
-# define RESX 0x0800 /* Bell Labs Research extension */
-# define BREAK 0x1000 /* break allowed inside */
-# define CONTINUE 0x2000 /* continue allowed inside */
+# define BREAK 0x0800 /* break allowed inside */
+# define CONTINUE 0x1000 /* continue allowed inside */
NODE *(*ptr)(int); /* function that implements this keyword */
NODE *(*ptr2)(int); /* alternate arbitrary-precision function */
@@ -1858,7 +1857,7 @@ static const struct token tokentab[] = {
{"eval", Op_symbol, LEX_EVAL, 0, 0, 0},
{"exit", Op_K_exit, LEX_EXIT, 0, 0, 0},
{"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)},
-{"fflush", Op_builtin, LEX_BUILTIN, RESX|A(0)|A(1), do_fflush, 0},
+{"fflush", Op_builtin, LEX_BUILTIN, A(0)|A(1), do_fflush, 0},
{"for", Op_K_for, LEX_FOR, BREAK|CONTINUE, 0, 0},
{"func", Op_func, LEX_FUNCTION, NOT_POSIX|NOT_OLD, 0, 0},
{"function",Op_func, LEX_FUNCTION, NOT_OLD, 0, 0},
@@ -3608,11 +3607,6 @@ retry:
tokentab[mid].operator);
warntab[mid] |= GAWKX;
}
- if ((tokentab[mid].flags & RESX) && ! (warntab[mid] & RESX)) {
- lintwarn(_("`%s' is a Bell Labs extension"),
- tokentab[mid].operator);
- warntab[mid] |= RESX;
- }
if ((tokentab[mid].flags & NOT_POSIX) && ! (warntab[mid] & NOT_POSIX)) {
lintwarn(_("POSIX does not allow `%s'"),
tokentab[mid].operator);
diff --git a/doc/ChangeLog b/doc/ChangeLog
index c3be84ec..402757f7 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.texi (I/O Functions): Document that fflush() is now part
+ of POSIX. Fix in a few other places as well.
+ * awkcard.in: Update for fflush().
+
2012-12-03 Arnold D. Robbins <arnold@skeeve.com>
* gawk.texi: Fix all @tex ... @end tex tables to use a different
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 2d003ca2..9df71344 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1333,13 +1333,12 @@ the problem.\*(CX
.fi
.in +.2i
.ti -.2i
-\*(CL\*(FCfflush(\*(FR[\*(FIfile\^\*(FR]\*(FC)\*(FR
+\*(CD\*(FCfflush(\*(FR[\*(FIfile\^\*(FR]\*(FC)\*(FR
.br
Flush any buffers associated
with the open output file or pipe \*(FIfile\*(FR.
If no \*(FIfile\fP, or if
-\*(FIfile\fP is null, then flush all open output files and pipes
-(\*(GK and \*(NK)\*(CD.
+\*(FIfile\fP is null, then flush all open output files and pipes.
.ti -.2i
\*(FCprint\fP
.br
diff --git a/doc/gawk.1 b/doc/gawk.1
index 6af5ffe2..8bc14bf6 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -14,7 +14,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Oct 02 2012" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Dec 07 2012" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -494,11 +494,6 @@ cannot be used in place of
.B ^
and
.BR ^= .
-.TP
-\(bu
-The
-.B fflush()
-function is not available.
.RE
.TP
.PD 0
@@ -3486,13 +3481,6 @@ escape sequence.
.BR \-\^\-posix .)
.TP
\(bu
-The
-.B fflush()
-function.
-(Disabled with
-.BR \-\^\-posix .)
-.TP
-\(bu
The ability to continue lines after
.B ?
and
diff --git a/doc/gawk.info b/doc/gawk.info
index c339dcbb..f28ba411 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -11913,7 +11913,7 @@ parameters are enclosed in square brackets ([ ]):
`fflush([FILENAME])'
Flush any buffered output associated with FILENAME, which is
either a file opened for writing or a shell command for
- redirecting output to a pipe or coprocess. (c.e.).
+ redirecting output to a pipe or coprocess.
Many utility programs "buffer" their output; i.e., they save
information to write to a disk file or the screen in memory until
@@ -11926,30 +11926,31 @@ parameters are enclosed in square brackets ([ ]):
function--`gawk' also buffers its output and the `fflush()'
function forces `gawk' to flush its buffers.
- `fflush()' was added to Brian Kernighan's version of `awk' in
- 1994; it is not part of the POSIX standard and is not available if
- `--posix' has been specified on the command line (*note Options::).
+ `fflush()' was added to Brian Kernighan's version of `awk' in 1994.
+ For over two decades, it was not part of the POSIX standard. As
+ of December, 2012, it was accepted for inclusion into the POSIX
+ standard. See the Austin Group website
+ (http://austingroupbugs.net/view.php?id=634).
- `gawk' extends the `fflush()' function, as follows: If there is no
- argument, or if the argument is the null string (`""'), `gawk'
- flushes the buffers for _all_ open output files and pipes. Brian
- Kernighan's `awk' also works this way.
+ POSIX standardizes `fflush()' as follows: If there is no argument,
+ or if the argument is the null string (`""'), then `awk' flushes
+ the buffers for _all_ open output files and pipes.
- NOTE: Prior to version *FIXME: VERSION*, `gawk' would flush
- only the standard output if there was no argument, and flush
- all output files and pipes if the argument was the null
- string. This was changed in order to be compatible with Brian
+ NOTE: Prior to version 4.0.2, `gawk' would flush only the
+ standard output if there was no argument, and flush all
+ output files and pipes if the argument was the null string.
+ This was changed in order to be compatible with Brian
Kernighan's `awk', in the hope that standardizing this
- feature in POSIX would then be easier.
+ feature in POSIX would then be easier (which indeed helped).
- You can use `fflush("/dev/stdout")' if you wish to flush only
- the standard output.
+ With `gawk', you can use `fflush("/dev/stdout")' if you wish
+ to flush only the standard output.
`fflush()' returns zero if the buffer is successfully flushed;
- otherwise, it returns -1. In the case where all buffers are
- flushed, the return value is zero only if all buffers were flushed
- successfully. Otherwise, it is -1, and `gawk' warns about the
- problem FILENAME.
+ otherwise, it returns non-zero (`gawk' returns -1). In the case
+ where all buffers are flushed, the return value is zero only if
+ all buffers were flushed successfully. Otherwise, it is -1, and
+ `gawk' warns about the problem FILENAME.
`gawk' also issues a warning message if you attempt to flush a
file or pipe that was opened for reading (such as with `getline'),
@@ -12026,7 +12027,7 @@ Advanced Notes: Controlling Output Buffering with `system()'
The `fflush()' function provides explicit control over output buffering
for individual files and pipes. However, its use is not portable to
-many other `awk' implementations. An alternative method to flush output
+many older `awk' implementations. An alternative method to flush output
buffers is to call `system()' with a null string as its argument:
system("") # flush output
@@ -25003,7 +25004,8 @@ in his version of `awk'.
Definition Syntax::).
* The `fflush()' built-in function for flushing buffered output
- (*note I/O Functions::).
+ (*note I/O Functions::). As of December 2012, this function is
+ now standardized by POSIX.
*Note Common Extensions::, for a full list of the extensions
@@ -25187,7 +25189,6 @@ Feature BWK Awk Mawk GNU Awk
`nextfile' statement X X X
`delete' without subscript X X X
`length()' of an array X X
-`fflush()' function X X X
`BINMODE' variable X X

@@ -29129,7 +29130,7 @@ Index
* --re-interval option: Options. (line 272)
* --sandbox option: Options. (line 279)
* --sandbox option, disabling system() function: I/O Functions.
- (line 93)
+ (line 94)
* --sandbox option, input redirection with getline: Getline. (line 19)
* --sandbox option, output redirection with print, printf: Redirection.
(line 6)
@@ -29298,7 +29299,7 @@ Index
* Ada programming language: Glossary. (line 20)
* adding, features to gawk: Adding Code. (line 6)
* adding, fields: Changing Fields. (line 53)
-* advanced features, buffering: I/O Functions. (line 106)
+* advanced features, buffering: I/O Functions. (line 107)
* advanced features, close() function: Close Files And Pipes.
(line 131)
* advanced features, constants, values of: Nondecimal-numbers.
@@ -29611,8 +29612,8 @@ Index
* Buening, Andreas <2>: Contributors. (line 92)
* Buening, Andreas: Acknowledgments. (line 60)
* buffering, input/output <1>: Two-way I/O. (line 70)
-* buffering, input/output: I/O Functions. (line 138)
-* buffering, interactive vs. noninteractive: I/O Functions. (line 106)
+* buffering, input/output: I/O Functions. (line 139)
+* buffering, interactive vs. noninteractive: I/O Functions. (line 107)
* buffers, flushing: I/O Functions. (line 29)
* buffers, operators for: GNU Regexp Operators.
(line 48)
@@ -30409,7 +30410,6 @@ Index
* gawk, extensions, disabling: Options. (line 247)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
-* gawk, fflush() function in: I/O Functions. (line 44)
* gawk, field separators and: User-modified. (line 77)
* gawk, FIELDWIDTHS variable in <1>: User-modified. (line 35)
* gawk, FIELDWIDTHS variable in: Constant Size. (line 22)
@@ -30641,7 +30641,7 @@ Index
(line 6)
* integers: General Arithmetic. (line 6)
* integers, unsigned: General Arithmetic. (line 15)
-* interacting with other programs: I/O Functions. (line 71)
+* interacting with other programs: I/O Functions. (line 72)
* internationalization <1>: I18N and L10N. (line 6)
* internationalization: I18N Functions. (line 6)
* internationalization, localization <1>: Internationalization.
@@ -31525,7 +31525,7 @@ Index
* SYMTAB array: Auto-set. (line 254)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
-* system() function: I/O Functions. (line 71)
+* system() function: I/O Functions. (line 72)
* systime() function (gawk): Time Functions. (line 64)
* t debugger command (alias for tbreak): Breakpoint Control. (line 90)
* tbreak debugger command: Breakpoint Control. (line 90)
@@ -31591,7 +31591,7 @@ Index
(line 22)
* troubleshooting, fatal errors, printf format strings: Format Modifiers.
(line 159)
-* troubleshooting, fflush() function: I/O Functions. (line 59)
+* troubleshooting, fflush() function: I/O Functions. (line 60)
* troubleshooting, function call syntax: Function Calls. (line 28)
* troubleshooting, gawk: Compatibility Mode. (line 6)
* troubleshooting, gawk, bug reports: Bugs. (line 9)
@@ -31610,7 +31610,7 @@ Index
(line 38)
* troubleshooting, string concatenation: Concatenation. (line 27)
* troubleshooting, substr() function: String Functions. (line 499)
-* troubleshooting, system() function: I/O Functions. (line 93)
+* troubleshooting, system() function: I/O Functions. (line 94)
* troubleshooting, typographical errors, global variables: Options.
(line 112)
* true, logical: Truth Values. (line 6)
@@ -31997,292 +31997,292 @@ Ref: table-gensub-escapes503205
Ref: Gory Details-Footnote-1504412
Ref: Gory Details-Footnote-2504463
Node: I/O Functions504614
-Ref: I/O Functions-Footnote-1511638
-Node: Time Functions511785
-Ref: Time Functions-Footnote-1522677
-Ref: Time Functions-Footnote-2522745
-Ref: Time Functions-Footnote-3522903
-Ref: Time Functions-Footnote-4523014
-Ref: Time Functions-Footnote-5523126
-Ref: Time Functions-Footnote-6523353
-Node: Bitwise Functions523619
-Ref: table-bitwise-ops524177
-Ref: Bitwise Functions-Footnote-1528398
-Node: Type Functions528582
-Node: I18N Functions529052
-Node: User-defined530679
-Node: Definition Syntax531483
-Ref: Definition Syntax-Footnote-1536393
-Node: Function Example536462
-Node: Function Caveats539056
-Node: Calling A Function539477
-Node: Variable Scope540592
-Node: Pass By Value/Reference543555
-Node: Return Statement546995
-Node: Dynamic Typing549976
-Node: Indirect Calls550711
-Node: Library Functions560396
-Ref: Library Functions-Footnote-1563395
-Node: Library Names563566
-Ref: Library Names-Footnote-1567037
-Ref: Library Names-Footnote-2567257
-Node: General Functions567343
-Node: Strtonum Function568296
-Node: Assert Function571226
-Node: Round Function574552
-Node: Cliff Random Function576095
-Node: Ordinal Functions577111
-Ref: Ordinal Functions-Footnote-1580181
-Ref: Ordinal Functions-Footnote-2580433
-Node: Join Function580642
-Ref: Join Function-Footnote-1582413
-Node: Getlocaltime Function582613
-Node: Data File Management586328
-Node: Filetrans Function586960
-Node: Rewind Function591099
-Node: File Checking592486
-Node: Empty Files593580
-Node: Ignoring Assigns595810
-Node: Getopt Function597363
-Ref: Getopt Function-Footnote-1608667
-Node: Passwd Functions608870
-Ref: Passwd Functions-Footnote-1617845
-Node: Group Functions617933
-Node: Walking Arrays626017
-Node: Sample Programs627586
-Node: Running Examples628263
-Node: Clones628991
-Node: Cut Program630215
-Node: Egrep Program640060
-Ref: Egrep Program-Footnote-1647833
-Node: Id Program647943
-Node: Split Program651559
-Ref: Split Program-Footnote-1655078
-Node: Tee Program655206
-Node: Uniq Program658009
-Node: Wc Program665438
-Ref: Wc Program-Footnote-1669704
-Ref: Wc Program-Footnote-2669904
-Node: Miscellaneous Programs669996
-Node: Dupword Program671184
-Node: Alarm Program673215
-Node: Translate Program677964
-Ref: Translate Program-Footnote-1682351
-Ref: Translate Program-Footnote-2682579
-Node: Labels Program682713
-Ref: Labels Program-Footnote-1686084
-Node: Word Sorting686168
-Node: History Sorting690052
-Node: Extract Program691891
-Ref: Extract Program-Footnote-1699374
-Node: Simple Sed699502
-Node: Igawk Program702564
-Ref: Igawk Program-Footnote-1717721
-Ref: Igawk Program-Footnote-2717922
-Node: Anagram Program718060
-Node: Signature Program721128
-Node: Internationalization722228
-Node: I18N and L10N723660
-Node: Explaining gettext724346
-Ref: Explaining gettext-Footnote-1729412
-Ref: Explaining gettext-Footnote-2729596
-Node: Programmer i18n729761
-Node: Translator i18n733961
-Node: String Extraction734754
-Ref: String Extraction-Footnote-1735715
-Node: Printf Ordering735801
-Ref: Printf Ordering-Footnote-1738585
-Node: I18N Portability738649
-Ref: I18N Portability-Footnote-1741098
-Node: I18N Example741161
-Ref: I18N Example-Footnote-1743796
-Node: Gawk I18N743868
-Node: Advanced Features744485
-Node: Nondecimal Data745989
-Node: Array Sorting747572
-Node: Controlling Array Traversal748269
-Node: Array Sorting Functions756507
-Ref: Array Sorting Functions-Footnote-1760181
-Ref: Array Sorting Functions-Footnote-2760274
-Node: Two-way I/O760468
-Ref: Two-way I/O-Footnote-1765900
-Node: TCP/IP Networking765970
-Node: Profiling768814
-Node: Debugger776268
-Node: Debugging777236
-Node: Debugging Concepts777669
-Node: Debugging Terms779525
-Node: Awk Debugging782122
-Node: Sample Debugging Session783014
-Node: Debugger Invocation783534
-Node: Finding The Bug784863
-Node: List of Debugger Commands791351
-Node: Breakpoint Control792685
-Node: Debugger Execution Control796349
-Node: Viewing And Changing Data799709
-Node: Execution Stack803065
-Node: Debugger Info804532
-Node: Miscellaneous Debugger Commands808513
-Node: Readline Support813958
-Node: Limitations814789
-Node: Arbitrary Precision Arithmetic817041
-Ref: Arbitrary Precision Arithmetic-Footnote-1818683
-Node: General Arithmetic818831
-Node: Floating Point Issues820551
-Node: String Conversion Precision821432
-Ref: String Conversion Precision-Footnote-1823138
-Node: Unexpected Results823247
-Node: POSIX Floating Point Problems825400
-Ref: POSIX Floating Point Problems-Footnote-1829225
-Node: Integer Programming829263
-Node: Floating-point Programming831016
-Ref: Floating-point Programming-Footnote-1837325
-Node: Floating-point Representation837589
-Node: Floating-point Context838754
-Ref: table-ieee-formats839596
-Node: Rounding Mode840980
-Ref: table-rounding-modes841459
-Ref: Rounding Mode-Footnote-1844463
-Node: Gawk and MPFR844644
-Node: Arbitrary Precision Floats845886
-Ref: Arbitrary Precision Floats-Footnote-1848315
-Node: Setting Precision848626
-Node: Setting Rounding Mode851359
-Ref: table-gawk-rounding-modes851763
-Node: Floating-point Constants852943
-Node: Changing Precision854367
-Ref: Changing Precision-Footnote-1855767
-Node: Exact Arithmetic855941
-Node: Arbitrary Precision Integers859049
-Ref: Arbitrary Precision Integers-Footnote-1862049
-Node: Dynamic Extensions862196
-Node: Extension Intro863582
-Node: Plugin License864790
-Node: Extension Design865464
-Node: Old Extension Problems866535
-Ref: Old Extension Problems-Footnote-1868045
-Node: Extension New Mechanism Goals868102
-Ref: Extension New Mechanism Goals-Footnote-1870814
-Node: Extension Other Design Decisions871000
-Node: Extension Mechanism Outline873112
-Ref: load-extension874137
-Ref: load-new-function875615
-Ref: call-new-function876596
-Node: Extension Future Growth878590
-Node: Extension API Description879408
-Node: Extension API Functions Introduction880736
-Node: General Data Types885436
-Ref: General Data Types-Footnote-1891038
-Node: Requesting Values891337
-Ref: table-value-types-returned892068
-Node: Constructor Functions893022
-Node: Registration Functions896018
-Node: Extension Functions896703
-Node: Exit Callback Functions898535
-Node: Extension Version String899778
-Node: Input Parsers900428
-Node: Output Wrappers909015
-Node: Two-way processors913431
-Node: Printing Messages915561
-Ref: Printing Messages-Footnote-1916638
-Node: Updating `ERRNO'916790
-Node: Accessing Parameters917529
-Node: Symbol Table Access918759
-Node: Symbol table by name919271
-Ref: Symbol table by name-Footnote-1921441
-Node: Symbol table by cookie921521
-Ref: Symbol table by cookie-Footnote-1925650
-Node: Cached values925713
-Ref: Cached values-Footnote-1929156
-Node: Array Manipulation929247
-Ref: Array Manipulation-Footnote-1930345
-Node: Array Data Types930384
-Ref: Array Data Types-Footnote-1933087
-Node: Array Functions933179
-Node: Flattening Arrays936945
-Node: Creating Arrays943778
-Node: Extension API Variables948573
-Node: Extension Versioning949209
-Node: Extension API Informational Variables951110
-Node: Extension API Boilerplate952196
-Node: Finding Extensions956027
-Node: Extension Example956574
-Node: Internal File Description957312
-Node: Internal File Ops961000
-Ref: Internal File Ops-Footnote-1972447
-Node: Using Internal File Ops972587
-Ref: Using Internal File Ops-Footnote-1974940
-Node: Extension Samples975206
-Node: Extension Sample File Functions976649
-Node: Extension Sample Fnmatch985122
-Node: Extension Sample Fork986848
-Node: Extension Sample Ord988062
-Node: Extension Sample Readdir988838
-Node: Extension Sample Revout990342
-Node: Extension Sample Rev2way990935
-Node: Extension Sample Read write array991625
-Node: Extension Sample Readfile993508
-Node: Extension Sample API Tests994263
-Node: Extension Sample Time994788
-Node: gawkextlib996095
-Node: Language History998476
-Node: V7/SVR3.1999998
-Node: SVR41002319
-Node: POSIX1003761
-Node: BTL1004769
-Node: POSIX/GNU1005503
-Node: Common Extensions1011038
-Node: Ranges and Locales1012145
-Ref: Ranges and Locales-Footnote-11016763
-Ref: Ranges and Locales-Footnote-21016790
-Ref: Ranges and Locales-Footnote-31017050
-Node: Contributors1017271
-Node: Installation1021567
-Node: Gawk Distribution1022461
-Node: Getting1022945
-Node: Extracting1023771
-Node: Distribution contents1025463
-Node: Unix Installation1030685
-Node: Quick Installation1031302
-Node: Additional Configuration Options1033264
-Node: Configuration Philosophy1034741
-Node: Non-Unix Installation1037083
-Node: PC Installation1037541
-Node: PC Binary Installation1038840
-Node: PC Compiling1040688
-Node: PC Testing1043632
-Node: PC Using1044808
-Node: Cygwin1048993
-Node: MSYS1049993
-Node: VMS Installation1050507
-Node: VMS Compilation1051110
-Ref: VMS Compilation-Footnote-11052117
-Node: VMS Installation Details1052175
-Node: VMS Running1053810
-Node: VMS Old Gawk1055417
-Node: Bugs1055891
-Node: Other Versions1059743
-Node: Notes1065058
-Node: Compatibility Mode1065717
-Node: Additions1066500
-Node: Accessing The Source1067427
-Node: Adding Code1069030
-Node: New Ports1075072
-Node: Derived Files1079207
-Ref: Derived Files-Footnote-11084515
-Ref: Derived Files-Footnote-21084549
-Ref: Derived Files-Footnote-31085149
-Node: Future Extensions1085247
-Node: Implementation Limitations1085828
-Node: Basic Concepts1087055
-Node: Basic High Level1087736
-Ref: figure-general-flow1088007
-Ref: figure-process-flow1088606
-Ref: Basic High Level-Footnote-11091835
-Node: Basic Data Typing1092020
-Node: Glossary1095375
-Node: Copying1120686
-Node: GNU Free Documentation License1158243
-Node: Index1183380
+Ref: I/O Functions-Footnote-1511719
+Node: Time Functions511866
+Ref: Time Functions-Footnote-1522758
+Ref: Time Functions-Footnote-2522826
+Ref: Time Functions-Footnote-3522984
+Ref: Time Functions-Footnote-4523095
+Ref: Time Functions-Footnote-5523207
+Ref: Time Functions-Footnote-6523434
+Node: Bitwise Functions523700
+Ref: table-bitwise-ops524258
+Ref: Bitwise Functions-Footnote-1528479
+Node: Type Functions528663
+Node: I18N Functions529133
+Node: User-defined530760
+Node: Definition Syntax531564
+Ref: Definition Syntax-Footnote-1536474
+Node: Function Example536543
+Node: Function Caveats539137
+Node: Calling A Function539558
+Node: Variable Scope540673
+Node: Pass By Value/Reference543636
+Node: Return Statement547076
+Node: Dynamic Typing550057
+Node: Indirect Calls550792
+Node: Library Functions560477
+Ref: Library Functions-Footnote-1563476
+Node: Library Names563647
+Ref: Library Names-Footnote-1567118
+Ref: Library Names-Footnote-2567338
+Node: General Functions567424
+Node: Strtonum Function568377
+Node: Assert Function571307
+Node: Round Function574633
+Node: Cliff Random Function576176
+Node: Ordinal Functions577192
+Ref: Ordinal Functions-Footnote-1580262
+Ref: Ordinal Functions-Footnote-2580514
+Node: Join Function580723
+Ref: Join Function-Footnote-1582494
+Node: Getlocaltime Function582694
+Node: Data File Management586409
+Node: Filetrans Function587041
+Node: Rewind Function591180
+Node: File Checking592567
+Node: Empty Files593661
+Node: Ignoring Assigns595891
+Node: Getopt Function597444
+Ref: Getopt Function-Footnote-1608748
+Node: Passwd Functions608951
+Ref: Passwd Functions-Footnote-1617926
+Node: Group Functions618014
+Node: Walking Arrays626098
+Node: Sample Programs627667
+Node: Running Examples628344
+Node: Clones629072
+Node: Cut Program630296
+Node: Egrep Program640141
+Ref: Egrep Program-Footnote-1647914
+Node: Id Program648024
+Node: Split Program651640
+Ref: Split Program-Footnote-1655159
+Node: Tee Program655287
+Node: Uniq Program658090
+Node: Wc Program665519
+Ref: Wc Program-Footnote-1669785
+Ref: Wc Program-Footnote-2669985
+Node: Miscellaneous Programs670077
+Node: Dupword Program671265
+Node: Alarm Program673296
+Node: Translate Program678045
+Ref: Translate Program-Footnote-1682432
+Ref: Translate Program-Footnote-2682660
+Node: Labels Program682794
+Ref: Labels Program-Footnote-1686165
+Node: Word Sorting686249
+Node: History Sorting690133
+Node: Extract Program691972
+Ref: Extract Program-Footnote-1699455
+Node: Simple Sed699583
+Node: Igawk Program702645
+Ref: Igawk Program-Footnote-1717802
+Ref: Igawk Program-Footnote-2718003
+Node: Anagram Program718141
+Node: Signature Program721209
+Node: Internationalization722309
+Node: I18N and L10N723741
+Node: Explaining gettext724427
+Ref: Explaining gettext-Footnote-1729493
+Ref: Explaining gettext-Footnote-2729677
+Node: Programmer i18n729842
+Node: Translator i18n734042
+Node: String Extraction734835
+Ref: String Extraction-Footnote-1735796
+Node: Printf Ordering735882
+Ref: Printf Ordering-Footnote-1738666
+Node: I18N Portability738730
+Ref: I18N Portability-Footnote-1741179
+Node: I18N Example741242
+Ref: I18N Example-Footnote-1743877
+Node: Gawk I18N743949
+Node: Advanced Features744566
+Node: Nondecimal Data746070
+Node: Array Sorting747653
+Node: Controlling Array Traversal748350
+Node: Array Sorting Functions756588
+Ref: Array Sorting Functions-Footnote-1760262
+Ref: Array Sorting Functions-Footnote-2760355
+Node: Two-way I/O760549
+Ref: Two-way I/O-Footnote-1765981
+Node: TCP/IP Networking766051
+Node: Profiling768895
+Node: Debugger776349
+Node: Debugging777317
+Node: Debugging Concepts777750
+Node: Debugging Terms779606
+Node: Awk Debugging782203
+Node: Sample Debugging Session783095
+Node: Debugger Invocation783615
+Node: Finding The Bug784944
+Node: List of Debugger Commands791432
+Node: Breakpoint Control792766
+Node: Debugger Execution Control796430
+Node: Viewing And Changing Data799790
+Node: Execution Stack803146
+Node: Debugger Info804613
+Node: Miscellaneous Debugger Commands808594
+Node: Readline Support814039
+Node: Limitations814870
+Node: Arbitrary Precision Arithmetic817122
+Ref: Arbitrary Precision Arithmetic-Footnote-1818764
+Node: General Arithmetic818912
+Node: Floating Point Issues820632
+Node: String Conversion Precision821513
+Ref: String Conversion Precision-Footnote-1823219
+Node: Unexpected Results823328
+Node: POSIX Floating Point Problems825481
+Ref: POSIX Floating Point Problems-Footnote-1829306
+Node: Integer Programming829344
+Node: Floating-point Programming831097
+Ref: Floating-point Programming-Footnote-1837406
+Node: Floating-point Representation837670
+Node: Floating-point Context838835
+Ref: table-ieee-formats839677
+Node: Rounding Mode841061
+Ref: table-rounding-modes841540
+Ref: Rounding Mode-Footnote-1844544
+Node: Gawk and MPFR844725
+Node: Arbitrary Precision Floats845967
+Ref: Arbitrary Precision Floats-Footnote-1848396
+Node: Setting Precision848707
+Node: Setting Rounding Mode851440
+Ref: table-gawk-rounding-modes851844
+Node: Floating-point Constants853024
+Node: Changing Precision854448
+Ref: Changing Precision-Footnote-1855848
+Node: Exact Arithmetic856022
+Node: Arbitrary Precision Integers859130
+Ref: Arbitrary Precision Integers-Footnote-1862130
+Node: Dynamic Extensions862277
+Node: Extension Intro863663
+Node: Plugin License864871
+Node: Extension Design865545
+Node: Old Extension Problems866616
+Ref: Old Extension Problems-Footnote-1868126
+Node: Extension New Mechanism Goals868183
+Ref: Extension New Mechanism Goals-Footnote-1870895
+Node: Extension Other Design Decisions871081
+Node: Extension Mechanism Outline873193
+Ref: load-extension874218
+Ref: load-new-function875696
+Ref: call-new-function876677
+Node: Extension Future Growth878671
+Node: Extension API Description879489
+Node: Extension API Functions Introduction880817
+Node: General Data Types885517
+Ref: General Data Types-Footnote-1891119
+Node: Requesting Values891418
+Ref: table-value-types-returned892149
+Node: Constructor Functions893103
+Node: Registration Functions896099
+Node: Extension Functions896784
+Node: Exit Callback Functions898616
+Node: Extension Version String899859
+Node: Input Parsers900509
+Node: Output Wrappers909096
+Node: Two-way processors913512
+Node: Printing Messages915642
+Ref: Printing Messages-Footnote-1916719
+Node: Updating `ERRNO'916871
+Node: Accessing Parameters917610
+Node: Symbol Table Access918840
+Node: Symbol table by name919352
+Ref: Symbol table by name-Footnote-1921522
+Node: Symbol table by cookie921602
+Ref: Symbol table by cookie-Footnote-1925731
+Node: Cached values925794
+Ref: Cached values-Footnote-1929237
+Node: Array Manipulation929328
+Ref: Array Manipulation-Footnote-1930426
+Node: Array Data Types930465
+Ref: Array Data Types-Footnote-1933168
+Node: Array Functions933260
+Node: Flattening Arrays937026
+Node: Creating Arrays943859
+Node: Extension API Variables948654
+Node: Extension Versioning949290
+Node: Extension API Informational Variables951191
+Node: Extension API Boilerplate952277
+Node: Finding Extensions956108
+Node: Extension Example956655
+Node: Internal File Description957393
+Node: Internal File Ops961081
+Ref: Internal File Ops-Footnote-1972528
+Node: Using Internal File Ops972668
+Ref: Using Internal File Ops-Footnote-1975021
+Node: Extension Samples975287
+Node: Extension Sample File Functions976730
+Node: Extension Sample Fnmatch985203
+Node: Extension Sample Fork986929
+Node: Extension Sample Ord988143
+Node: Extension Sample Readdir988919
+Node: Extension Sample Revout990423
+Node: Extension Sample Rev2way991016
+Node: Extension Sample Read write array991706
+Node: Extension Sample Readfile993589
+Node: Extension Sample API Tests994344
+Node: Extension Sample Time994869
+Node: gawkextlib996176
+Node: Language History998557
+Node: V7/SVR3.11000079
+Node: SVR41002400
+Node: POSIX1003842
+Node: BTL1004850
+Node: POSIX/GNU1005655
+Node: Common Extensions1011190
+Node: Ranges and Locales1012249
+Ref: Ranges and Locales-Footnote-11016867
+Ref: Ranges and Locales-Footnote-21016894
+Ref: Ranges and Locales-Footnote-31017154
+Node: Contributors1017375
+Node: Installation1021671
+Node: Gawk Distribution1022565
+Node: Getting1023049
+Node: Extracting1023875
+Node: Distribution contents1025567
+Node: Unix Installation1030789
+Node: Quick Installation1031406
+Node: Additional Configuration Options1033368
+Node: Configuration Philosophy1034845
+Node: Non-Unix Installation1037187
+Node: PC Installation1037645
+Node: PC Binary Installation1038944
+Node: PC Compiling1040792
+Node: PC Testing1043736
+Node: PC Using1044912
+Node: Cygwin1049097
+Node: MSYS1050097
+Node: VMS Installation1050611
+Node: VMS Compilation1051214
+Ref: VMS Compilation-Footnote-11052221
+Node: VMS Installation Details1052279
+Node: VMS Running1053914
+Node: VMS Old Gawk1055521
+Node: Bugs1055995
+Node: Other Versions1059847
+Node: Notes1065162
+Node: Compatibility Mode1065821
+Node: Additions1066604
+Node: Accessing The Source1067531
+Node: Adding Code1069134
+Node: New Ports1075176
+Node: Derived Files1079311
+Ref: Derived Files-Footnote-11084619
+Ref: Derived Files-Footnote-21084653
+Ref: Derived Files-Footnote-31085253
+Node: Future Extensions1085351
+Node: Implementation Limitations1085932
+Node: Basic Concepts1087159
+Node: Basic High Level1087840
+Ref: figure-general-flow1088111
+Ref: figure-process-flow1088710
+Ref: Basic High Level-Footnote-11091939
+Node: Basic Data Typing1092124
+Node: Glossary1095479
+Node: Copying1120790
+Node: GNU Free Documentation License1158347
+Node: Index1183484

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 835dbc00..63dfcb9d 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -20,7 +20,7 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH November, 2012
+@set UPDATE-MONTH December, 2012
@set VERSION 4.0
@set PATCHLEVEL 2
@@ -15990,7 +15990,7 @@ which discusses this feature in more detail and gives an example.
@cindex extensions, common@comma{} @code{fflush()} function
Flush any buffered output associated with @var{filename}, which is either a
file opened for writing or a shell command for redirecting output to
-a pipe or coprocess. @value{COMMONEXT}.
+a pipe or coprocess.
@cindex portability, @code{fflush()} function and
@cindex buffers, flushing
@@ -16007,25 +16007,27 @@ buffers its output and the @code{fflush()} function forces
@command{gawk} to flush its buffers.
@code{fflush()} was added to Brian Kernighan's
-version of @command{awk} in 1994; it is not part of the POSIX standard and is
-not available if @option{--posix} has been specified on the
-command line (@pxref{Options}).
+version of @command{awk} in 1994.
+For over two decades, it was not part of the POSIX standard.
+As of December, 2012, it was accepted for
+inclusion into the POSIX standard.
+See @uref{http://austingroupbugs.net/view.php?id=634, the Austin Group website}.
-@cindex @command{gawk}, @code{fflush()} function in
-@command{gawk} extends the @code{fflush()} function, as follows: If there
+POSIX standardizes @code{fflush()} as follows: If there
is no argument, or if the argument is the null string (@w{@code{""}}),
-@command{gawk} flushes the buffers for @emph{all} open output files
-and pipes. Brian Kernighan's @command{awk} also works this way.
+then @command{awk} flushes the buffers for @emph{all} open output files
+and pipes.
@quotation NOTE
-Prior to version @strong{FIXME: VERSION}, @command{gawk}
+Prior to version 4.0.2, @command{gawk}
would flush only the standard output if there was no argument,
and flush all output files and pipes if the argument was the null
string. This was changed in order to be compatible with Brian
Kernighan's @command{awk}, in the hope that standardizing this
-feature in POSIX would then be easier.
+feature in POSIX would then be easier (which indeed helped).
-You can use @samp{fflush("/dev/stdout")} if you wish to flush
+With @command{gawk},
+you can use @samp{fflush("/dev/stdout")} if you wish to flush
only the standard output.
@end quotation
@@ -16033,7 +16035,7 @@ only the standard output.
@c @cindex warnings, automatic
@cindex troubleshooting, @code{fflush()} function
@code{fflush()} returns zero if the buffer is successfully flushed;
-otherwise, it returns @minus{}1.
+otherwise, it returns non-zero (@command{gawk} returns @minus{}1).
In the case where all buffers are flushed, the return value is zero
only if all buffers were flushed successfully. Otherwise, it is
@minus{}1, and @command{gawk} warns about the problem @var{filename}.
@@ -16141,7 +16143,7 @@ it is all buffered and sent down the pipe to @command{cat} in one shot.
@cindex output, buffering
The @code{fflush()} function provides explicit control over output buffering for
-individual files and pipes. However, its use is not portable to many other
+individual files and pipes. However, its use is not portable to many older
@command{awk} implementations. An alternative method to flush output
buffers is to call @code{system()} with a null string as its argument:
@@ -32274,6 +32276,7 @@ The use of @code{func} as an abbreviation for @code{function}
@item
The @code{fflush()} built-in function for flushing buffered output
(@pxref{I/O Functions}).
+As of December 2012, this function is now standardized by POSIX.
@ignore
@item
@@ -32626,7 +32629,6 @@ the three most widely-used freely available versions of @command{awk}
@item @code{nextfile} statement @tab X @tab X @tab X
@item @code{delete} without subscript @tab X @tab X @tab X
@item @code{length()} of an array @tab X @tab @tab X
-@item @code{fflush()} function @tab X @tab X @tab X
@item @code{BINMODE} variable @tab @tab X @tab X
@end multitable