diff options
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | awkgram.c | 12 | ||||
-rw-r--r-- | awkgram.y | 12 | ||||
-rw-r--r-- | doc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/awkcard.in | 5 | ||||
-rw-r--r-- | doc/gawk.1 | 14 | ||||
-rw-r--r-- | doc/gawk.info | 576 | ||||
-rw-r--r-- | doc/gawk.texi | 32 |
9 files changed, 597 insertions, 81 deletions
@@ -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 @@ -220,6 +229,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. @@ -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 --------------------------- @@ -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 */ @@ -4392,7 +4391,7 @@ static const struct token tokentab[] = { {"exit", Op_K_exit, LEX_EXIT, 0, 0, 0}, {"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)}, {"extension", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_ext, 0}, -{"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}, @@ -6142,11 +6141,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); @@ -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 */ @@ -1859,7 +1858,7 @@ static const struct token tokentab[] = { {"exit", Op_K_exit, LEX_EXIT, 0, 0, 0}, {"exp", Op_builtin, LEX_BUILTIN, A(1), do_exp, MPF(exp)}, {"extension", Op_builtin, LEX_BUILTIN, GAWKX|A(1)|A(2)|A(3), do_ext, 0}, -{"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}, @@ -3609,11 +3608,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 dbf025db..685338b3 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 @@ -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 99a3c693..09f30433 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -11914,7 +11914,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 @@ -11927,30 +11927,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'), @@ -12027,7 +12028,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 @@ -25004,7 +25005,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 @@ -25188,7 +25190,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 @@ -29170,7 +29171,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) @@ -29339,7 +29340,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. @@ -29652,8 +29653,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) @@ -30450,7 +30451,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) @@ -30682,7 +30682,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. @@ -31566,7 +31566,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) @@ -31632,7 +31632,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) @@ -31651,7 +31651,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) @@ -31814,6 +31814,7 @@ Index Tag Table: Node: Top1352 +<<<<<<< HEAD Node: Foreword40217 Node: Preface44562 Ref: Preface-Footnote-147615 @@ -32326,5 +32327,518 @@ Node: Glossary1097324 Node: Copying1122635 Node: GNU Free Documentation License1160192 Node: Index1185329 +======= +Node: Foreword40138 +Node: Preface44483 +Ref: Preface-Footnote-147536 +Ref: Preface-Footnote-247642 +Node: History47874 +Node: Names50265 +Ref: Names-Footnote-151742 +Node: This Manual51814 +Ref: This Manual-Footnote-157720 +Node: Conventions57820 +Node: Manual History59954 +Ref: Manual History-Footnote-163224 +Ref: Manual History-Footnote-263265 +Node: How To Contribute63339 +Node: Acknowledgments64483 +Node: Getting Started68979 +Node: Running gawk71358 +Node: One-shot72544 +Node: Read Terminal73769 +Ref: Read Terminal-Footnote-175419 +Ref: Read Terminal-Footnote-275695 +Node: Long75866 +Node: Executable Scripts77242 +Ref: Executable Scripts-Footnote-179111 +Ref: Executable Scripts-Footnote-279213 +Node: Comments79760 +Node: Quoting82227 +Node: DOS Quoting86850 +Node: Sample Data Files87525 +Node: Very Simple90557 +Node: Two Rules95156 +Node: More Complex97303 +Ref: More Complex-Footnote-1100233 +Node: Statements/Lines100318 +Ref: Statements/Lines-Footnote-1104780 +Node: Other Features105045 +Node: When105973 +Node: Invoking Gawk108120 +Node: Command Line109581 +Node: Options110364 +Ref: Options-Footnote-1125762 +Node: Other Arguments125787 +Node: Naming Standard Input128445 +Node: Environment Variables129539 +Node: AWKPATH Variable130097 +Ref: AWKPATH Variable-Footnote-1132855 +Node: AWKLIBPATH Variable133115 +Node: Other Environment Variables133712 +Node: Exit Status136207 +Node: Include Files136882 +Node: Loading Shared Libraries140451 +Node: Obsolete141676 +Node: Undocumented142373 +Node: Regexp142616 +Node: Regexp Usage144005 +Node: Escape Sequences146031 +Node: Regexp Operators151794 +Ref: Regexp Operators-Footnote-1159174 +Ref: Regexp Operators-Footnote-2159321 +Node: Bracket Expressions159419 +Ref: table-char-classes161309 +Node: GNU Regexp Operators163832 +Node: Case-sensitivity167555 +Ref: Case-sensitivity-Footnote-1170523 +Ref: Case-sensitivity-Footnote-2170758 +Node: Leftmost Longest170866 +Node: Computed Regexps172067 +Node: Reading Files175477 +Node: Records177480 +Ref: Records-Footnote-1186404 +Node: Fields186441 +Ref: Fields-Footnote-1189474 +Node: Nonconstant Fields189560 +Node: Changing Fields191762 +Node: Field Separators197743 +Node: Default Field Splitting200372 +Node: Regexp Field Splitting201489 +Node: Single Character Fields204831 +Node: Command Line Field Separator205890 +Node: Field Splitting Summary209331 +Ref: Field Splitting Summary-Footnote-1212523 +Node: Constant Size212624 +Node: Splitting By Content217208 +Ref: Splitting By Content-Footnote-1220934 +Node: Multiple Line220974 +Ref: Multiple Line-Footnote-1226821 +Node: Getline227000 +Node: Plain Getline229216 +Node: Getline/Variable231305 +Node: Getline/File232446 +Node: Getline/Variable/File233768 +Ref: Getline/Variable/File-Footnote-1235367 +Node: Getline/Pipe235454 +Node: Getline/Variable/Pipe238014 +Node: Getline/Coprocess239121 +Node: Getline/Variable/Coprocess240364 +Node: Getline Notes241078 +Node: Getline Summary243865 +Ref: table-getline-variants244273 +Node: Read Timeout245131 +Ref: Read Timeout-Footnote-1248876 +Node: Command line directories248933 +Node: Printing249563 +Node: Print251194 +Node: Print Examples252531 +Node: Output Separators255315 +Node: OFMT257075 +Node: Printf258433 +Node: Basic Printf259339 +Node: Control Letters260878 +Node: Format Modifiers264690 +Node: Printf Examples270699 +Node: Redirection273414 +Node: Special Files280398 +Node: Special FD280931 +Ref: Special FD-Footnote-1284556 +Node: Special Network284630 +Node: Special Caveats285480 +Node: Close Files And Pipes286276 +Ref: Close Files And Pipes-Footnote-1293299 +Ref: Close Files And Pipes-Footnote-2293447 +Node: Expressions293597 +Node: Values294729 +Node: Constants295405 +Node: Scalar Constants296085 +Ref: Scalar Constants-Footnote-1296944 +Node: Nondecimal-numbers297126 +Node: Regexp Constants300185 +Node: Using Constant Regexps300660 +Node: Variables303715 +Node: Using Variables304370 +Node: Assignment Options306094 +Node: Conversion307966 +Ref: table-locale-affects313342 +Ref: Conversion-Footnote-1313966 +Node: All Operators314075 +Node: Arithmetic Ops314705 +Node: Concatenation317210 +Ref: Concatenation-Footnote-1320003 +Node: Assignment Ops320123 +Ref: table-assign-ops325111 +Node: Increment Ops326519 +Node: Truth Values and Conditions329989 +Node: Truth Values331072 +Node: Typing and Comparison332121 +Node: Variable Typing332910 +Ref: Variable Typing-Footnote-1336807 +Node: Comparison Operators336929 +Ref: table-relational-ops337339 +Node: POSIX String Comparison340888 +Ref: POSIX String Comparison-Footnote-1341844 +Node: Boolean Ops341982 +Ref: Boolean Ops-Footnote-1346060 +Node: Conditional Exp346151 +Node: Function Calls347883 +Node: Precedence351477 +Node: Locales355146 +Node: Patterns and Actions356235 +Node: Pattern Overview357289 +Node: Regexp Patterns358958 +Node: Expression Patterns359501 +Node: Ranges363186 +Node: BEGIN/END366152 +Node: Using BEGIN/END366914 +Ref: Using BEGIN/END-Footnote-1369645 +Node: I/O And BEGIN/END369751 +Node: BEGINFILE/ENDFILE372033 +Node: Empty374937 +Node: Using Shell Variables375253 +Node: Action Overview377538 +Node: Statements379895 +Node: If Statement381749 +Node: While Statement383248 +Node: Do Statement385292 +Node: For Statement386448 +Node: Switch Statement389600 +Node: Break Statement391697 +Node: Continue Statement393687 +Node: Next Statement395480 +Node: Nextfile Statement397870 +Node: Exit Statement400511 +Node: Built-in Variables402927 +Node: User-modified404022 +Ref: User-modified-Footnote-1412377 +Node: Auto-set412439 +Ref: Auto-set-Footnote-1424790 +Ref: Auto-set-Footnote-2424995 +Node: ARGC and ARGV425051 +Node: Arrays428902 +Node: Array Basics430407 +Node: Array Intro431233 +Node: Reference to Elements435551 +Node: Assigning Elements437821 +Node: Array Example438312 +Node: Scanning an Array440044 +Node: Controlling Scanning442358 +Ref: Controlling Scanning-Footnote-1447291 +Node: Delete447607 +Ref: Delete-Footnote-1450372 +Node: Numeric Array Subscripts450429 +Node: Uninitialized Subscripts452612 +Node: Multi-dimensional454240 +Node: Multi-scanning457334 +Node: Arrays of Arrays458925 +Node: Functions463570 +Node: Built-in464389 +Node: Calling Built-in465467 +Node: Numeric Functions467455 +Ref: Numeric Functions-Footnote-1471287 +Ref: Numeric Functions-Footnote-2471644 +Ref: Numeric Functions-Footnote-3471692 +Node: String Functions471961 +Ref: String Functions-Footnote-1495458 +Ref: String Functions-Footnote-2495587 +Ref: String Functions-Footnote-3495835 +Node: Gory Details495922 +Ref: table-sub-escapes497601 +Ref: table-sub-posix-92498955 +Ref: table-sub-proposed500306 +Ref: table-posix-sub501660 +Ref: table-gensub-escapes503205 +Ref: Gory Details-Footnote-1504412 +Ref: Gory Details-Footnote-2504463 +Node: I/O Functions504614 +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 +>>>>>>> master End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 48d6dbee..5b6ea931 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 @@ -15991,7 +15991,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 @@ -16008,25 +16008,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 @@ -16034,7 +16036,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}. @@ -16142,7 +16144,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: @@ -32275,6 +32277,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 @@ -32627,7 +32630,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 |