summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-03-17 22:49:13 +0200
committerArnold D. Robbins <arnold@skeeve.com>2015-03-17 22:49:13 +0200
commitcd2ff61aaf4938092517880ad7655828d99a3cb9 (patch)
tree3631ccc516791f59c36a40353cb1bd9af5ee6dc1
parent36bf73d7bacb7e38598ce194315dce896a2847a3 (diff)
parentcffd09247c1681fbf3d5cad5253b3199704f83e7 (diff)
downloadgawk-array-iface.tar.gz
Merge branch 'gawk-4.1-stable'array-iface
-rw-r--r--ChangeLog6
-rw-r--r--doc/ChangeLog6
-rw-r--r--doc/gawk.info947
-rw-r--r--doc/gawk.texi12
-rw-r--r--doc/gawktexi.in12
-rw-r--r--extension/ChangeLog6
-rw-r--r--extension/inplace.3am7
-rw-r--r--extension/inplace.c4
-rw-r--r--profile.c26
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am11
-rw-r--r--test/Makefile.in11
-rw-r--r--test/mpfrmemok1.awk7
-rw-r--r--test/mpfrmemok1.ok7
14 files changed, 567 insertions, 500 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e784a60..21e90e4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pp_number): Allocate enough room to print the number
+ in all cases. Was a problem mixing -M with profiling with a really
+ big number. Thanks to Hermann Peifer for the bug report.
+
2015-03-08 Arnold D. Robbins <arnold@skeeve.com>
* re.c (regexflags2str): Removed. It was redundant.
diff --git a/doc/ChangeLog b/doc/ChangeLog
index b58699a4..4fb63919 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Turn "positive" into non-negative as appropriate.
+ Thanks to Nicholas Mills <nlmills@clemson.edu> for pointing out
+ the issue.
+
2015-03-08 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Briefly describe that nonfatal I/O overrides
diff --git a/doc/gawk.info b/doc/gawk.info
index 7e548a8e..90ae5848 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -5100,9 +5100,9 @@ the built-in variable `FIELDWIDTHS'. Each number specifies the width
of the field, _including_ columns between fields. If you want to
ignore the columns between fields, you can specify the width as a
separate field that is subsequently ignored. It is a fatal error to
-supply a field width that is not a positive number. The following data
-is the output of the Unix `w' utility. It is useful to illustrate the
-use of `FIELDWIDTHS':
+supply a field width that has a negative value. The following data is
+the output of the Unix `w' utility. It is useful to illustrate the use
+of `FIELDWIDTHS':
10:06pm up 21 days, 14:04, 23 users
User tty login idle JCPU PCPU what
@@ -10933,7 +10933,7 @@ be used as an array index.
including a specification of how many elements or components they
contain. In such languages, the declaration causes a contiguous block
of memory to be allocated for that many elements. Usually, an index in
-the array must be a positive integer. For example, the index zero
+the array must be a nonnegative integer. For example, the index zero
specifies the first element in the array, which is actually stored at
the beginning of the block of memory. Index one specifies the second
element, which is stored in memory right after the first element, and
@@ -10988,8 +10988,8 @@ It has elements 0-3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or
9.
Another consequence of associative arrays is that the indices don't
-have to be positive integers. Any number, or even a string, can be an
-index. For example, the following is an array that translates words
+have to be nonnegative integers. Any number, or even a string, can be
+an index. For example, the following is an array that translates words
from English to French:
Index Value
@@ -11160,7 +11160,7 @@ File: gawk.info, Node: Scanning an Array, Next: Controlling Scanning, Prev: A
In programs that use arrays, it is often necessary to use a loop that
executes once for each element of an array. In other languages, where
-arrays are contiguous and indices are limited to positive integers,
+arrays are contiguous and indices are limited to nonnegative integers,
this is easy: all the valid indices can be found by counting from the
lowest index up to the highest. This technique won't do the job in
`awk', because any number or string can be an array index. So `awk'
@@ -21903,8 +21903,7 @@ Integer arithmetic
In computers, integer values come in two flavors: "signed" and
"unsigned". Signed values may be negative or positive, whereas
- unsigned values are always positive (i.e., greater than or equal
- to zero).
+ unsigned values are always greater than or equal to zero.
In computer systems, integer arithmetic is exact, but the possible
range of values is limited. Integer arithmetic is generally
@@ -34830,470 +34829,470 @@ Ref: Full Line Fields-Footnote-1225693
Ref: Full Line Fields-Footnote-2225739
Node: Field Splitting Summary225840
Node: Constant Size227914
-Node: Splitting By Content232497
-Ref: Splitting By Content-Footnote-1236462
-Node: Multiple Line236625
-Ref: Multiple Line-Footnote-1242506
-Node: Getline242685
-Node: Plain Getline244892
-Node: Getline/Variable247532
-Node: Getline/File248681
-Node: Getline/Variable/File250066
-Ref: Getline/Variable/File-Footnote-1251669
-Node: Getline/Pipe251756
-Node: Getline/Variable/Pipe254434
-Node: Getline/Coprocess255565
-Node: Getline/Variable/Coprocess256829
-Node: Getline Notes257568
-Node: Getline Summary260362
-Ref: table-getline-variants260774
-Node: Read Timeout261603
-Ref: Read Timeout-Footnote-1265440
-Node: Command-line directories265498
-Node: Input Summary266403
-Node: Input Exercises269788
-Node: Printing270516
-Node: Print272351
-Node: Print Examples273808
-Node: Output Separators276587
-Node: OFMT278605
-Node: Printf279960
-Node: Basic Printf280745
-Node: Control Letters282317
-Node: Format Modifiers286302
-Node: Printf Examples292308
-Node: Redirection294794
-Node: Special FD301632
-Ref: Special FD-Footnote-1304798
-Node: Special Files304872
-Node: Other Inherited Files305489
-Node: Special Network306489
-Node: Special Caveats307351
-Node: Close Files And Pipes308300
-Ref: Close Files And Pipes-Footnote-1315485
-Ref: Close Files And Pipes-Footnote-2315633
-Node: Nonfatal315783
-Node: Output Summary318108
-Node: Output Exercises319329
-Node: Expressions320009
-Node: Values321198
-Node: Constants321875
-Node: Scalar Constants322566
-Ref: Scalar Constants-Footnote-1323428
-Node: Nondecimal-numbers323678
-Node: Regexp Constants326688
-Node: Using Constant Regexps327214
-Node: Variables330377
-Node: Using Variables331034
-Node: Assignment Options332945
-Node: Conversion334820
-Node: Strings And Numbers335344
-Ref: Strings And Numbers-Footnote-1338409
-Node: Locale influences conversions338518
-Ref: table-locale-affects341264
-Node: All Operators341856
-Node: Arithmetic Ops342485
-Node: Concatenation344990
-Ref: Concatenation-Footnote-1347809
-Node: Assignment Ops347916
-Ref: table-assign-ops352895
-Node: Increment Ops354205
-Node: Truth Values and Conditions357636
-Node: Truth Values358719
-Node: Typing and Comparison359768
-Node: Variable Typing360584
-Node: Comparison Operators364251
-Ref: table-relational-ops364661
-Node: POSIX String Comparison368156
-Ref: POSIX String Comparison-Footnote-1369228
-Node: Boolean Ops369367
-Ref: Boolean Ops-Footnote-1373845
-Node: Conditional Exp373936
-Node: Function Calls375674
-Node: Precedence379554
-Node: Locales383214
-Node: Expressions Summary384846
-Node: Patterns and Actions387417
-Node: Pattern Overview388537
-Node: Regexp Patterns390216
-Node: Expression Patterns390759
-Node: Ranges394539
-Node: BEGIN/END397646
-Node: Using BEGIN/END398407
-Ref: Using BEGIN/END-Footnote-1401143
-Node: I/O And BEGIN/END401249
-Node: BEGINFILE/ENDFILE403564
-Node: Empty406461
-Node: Using Shell Variables406778
-Node: Action Overview409051
-Node: Statements411377
-Node: If Statement413225
-Node: While Statement414720
-Node: Do Statement416748
-Node: For Statement417896
-Node: Switch Statement421054
-Node: Break Statement423436
-Node: Continue Statement425529
-Node: Next Statement427356
-Node: Nextfile Statement429737
-Node: Exit Statement432365
-Node: Built-in Variables434776
-Node: User-modified435909
-Ref: User-modified-Footnote-1443543
-Node: Auto-set443605
-Ref: Auto-set-Footnote-1457314
-Ref: Auto-set-Footnote-2457519
-Node: ARGC and ARGV457575
-Node: Pattern Action Summary461793
-Node: Arrays464226
-Node: Array Basics465555
-Node: Array Intro466399
-Ref: figure-array-elements468333
-Ref: Array Intro-Footnote-1470953
-Node: Reference to Elements471081
-Node: Assigning Elements473543
-Node: Array Example474034
-Node: Scanning an Array475793
-Node: Controlling Scanning478813
-Ref: Controlling Scanning-Footnote-1484207
-Node: Numeric Array Subscripts484523
-Node: Uninitialized Subscripts486708
-Node: Delete488325
-Ref: Delete-Footnote-1491074
-Node: Multidimensional491131
-Node: Multiscanning494228
-Node: Arrays of Arrays495817
-Node: Arrays Summary500571
-Node: Functions502662
-Node: Built-in503701
-Node: Calling Built-in504779
-Node: Numeric Functions506774
-Ref: Numeric Functions-Footnote-1511592
-Ref: Numeric Functions-Footnote-2511949
-Ref: Numeric Functions-Footnote-3511997
-Node: String Functions512269
-Ref: String Functions-Footnote-1535770
-Ref: String Functions-Footnote-2535899
-Ref: String Functions-Footnote-3536147
-Node: Gory Details536234
-Ref: table-sub-escapes538015
-Ref: table-sub-proposed539530
-Ref: table-posix-sub540892
-Ref: table-gensub-escapes542429
-Ref: Gory Details-Footnote-1543262
-Node: I/O Functions543413
-Ref: I/O Functions-Footnote-1550649
-Node: Time Functions550796
-Ref: Time Functions-Footnote-1561305
-Ref: Time Functions-Footnote-2561373
-Ref: Time Functions-Footnote-3561531
-Ref: Time Functions-Footnote-4561642
-Ref: Time Functions-Footnote-5561754
-Ref: Time Functions-Footnote-6561981
-Node: Bitwise Functions562247
-Ref: table-bitwise-ops562809
-Ref: Bitwise Functions-Footnote-1567137
-Node: Type Functions567309
-Node: I18N Functions568461
-Node: User-defined570108
-Node: Definition Syntax570913
-Ref: Definition Syntax-Footnote-1576572
-Node: Function Example576643
-Ref: Function Example-Footnote-1579564
-Node: Function Caveats579586
-Node: Calling A Function580104
-Node: Variable Scope581062
-Node: Pass By Value/Reference584055
-Node: Return Statement587552
-Node: Dynamic Typing590531
-Node: Indirect Calls591460
-Ref: Indirect Calls-Footnote-1601325
-Node: Functions Summary601453
-Node: Library Functions604155
-Ref: Library Functions-Footnote-1607763
-Ref: Library Functions-Footnote-2607906
-Node: Library Names608077
-Ref: Library Names-Footnote-1611535
-Ref: Library Names-Footnote-2611758
-Node: General Functions611844
-Node: Strtonum Function612947
-Node: Assert Function615969
-Node: Round Function619293
-Node: Cliff Random Function620834
-Node: Ordinal Functions621850
-Ref: Ordinal Functions-Footnote-1624913
-Ref: Ordinal Functions-Footnote-2625165
-Node: Join Function625376
-Ref: Join Function-Footnote-1627146
-Node: Getlocaltime Function627346
-Node: Readfile Function631090
-Node: Shell Quoting633062
-Node: Data File Management634463
-Node: Filetrans Function635095
-Node: Rewind Function639191
-Node: File Checking640577
-Ref: File Checking-Footnote-1641910
-Node: Empty Files642111
-Node: Ignoring Assigns644090
-Node: Getopt Function645640
-Ref: Getopt Function-Footnote-1657104
-Node: Passwd Functions657304
-Ref: Passwd Functions-Footnote-1666144
-Node: Group Functions666232
-Ref: Group Functions-Footnote-1674129
-Node: Walking Arrays674334
-Node: Library Functions Summary677340
-Node: Library Exercises678742
-Node: Sample Programs680022
-Node: Running Examples680792
-Node: Clones681520
-Node: Cut Program682744
-Node: Egrep Program692464
-Ref: Egrep Program-Footnote-1699967
-Node: Id Program700077
-Node: Split Program703753
-Ref: Split Program-Footnote-1707207
-Node: Tee Program707335
-Node: Uniq Program710124
-Node: Wc Program717543
-Ref: Wc Program-Footnote-1721793
-Node: Miscellaneous Programs721887
-Node: Dupword Program723100
-Node: Alarm Program725131
-Node: Translate Program729936
-Ref: Translate Program-Footnote-1734499
-Node: Labels Program734769
-Ref: Labels Program-Footnote-1738120
-Node: Word Sorting738204
-Node: History Sorting742274
-Node: Extract Program744109
-Node: Simple Sed751633
-Node: Igawk Program754703
-Ref: Igawk Program-Footnote-1769029
-Ref: Igawk Program-Footnote-2769230
-Ref: Igawk Program-Footnote-3769352
-Node: Anagram Program769467
-Node: Signature Program772528
-Node: Programs Summary773775
-Node: Programs Exercises774996
-Ref: Programs Exercises-Footnote-1779127
-Node: Advanced Features779218
-Node: Nondecimal Data781200
-Node: Array Sorting782790
-Node: Controlling Array Traversal783490
-Ref: Controlling Array Traversal-Footnote-1791856
-Node: Array Sorting Functions791974
-Ref: Array Sorting Functions-Footnote-1795860
-Node: Two-way I/O796056
-Ref: Two-way I/O-Footnote-1801001
-Ref: Two-way I/O-Footnote-2801187
-Node: TCP/IP Networking801269
-Node: Profiling804141
-Node: Advanced Features Summary812412
-Node: Internationalization814345
-Node: I18N and L10N815825
-Node: Explaining gettext816511
-Ref: Explaining gettext-Footnote-1821536
-Ref: Explaining gettext-Footnote-2821720
-Node: Programmer i18n821885
-Ref: Programmer i18n-Footnote-1826761
-Node: Translator i18n826810
-Node: String Extraction827604
-Ref: String Extraction-Footnote-1828735
-Node: Printf Ordering828821
-Ref: Printf Ordering-Footnote-1831607
-Node: I18N Portability831671
-Ref: I18N Portability-Footnote-1834127
-Node: I18N Example834190
-Ref: I18N Example-Footnote-1836993
-Node: Gawk I18N837065
-Node: I18N Summary837709
-Node: Debugger839049
-Node: Debugging840071
-Node: Debugging Concepts840512
-Node: Debugging Terms842322
-Node: Awk Debugging844894
-Node: Sample Debugging Session845800
-Node: Debugger Invocation846334
-Node: Finding The Bug847719
-Node: List of Debugger Commands854198
-Node: Breakpoint Control855530
-Node: Debugger Execution Control859207
-Node: Viewing And Changing Data862566
-Node: Execution Stack865942
-Node: Debugger Info867577
-Node: Miscellaneous Debugger Commands871622
-Node: Readline Support876623
-Node: Limitations877517
-Node: Debugging Summary879632
-Node: Arbitrary Precision Arithmetic880806
-Node: Computer Arithmetic882222
-Ref: table-numeric-ranges885821
-Ref: Computer Arithmetic-Footnote-1886345
-Node: Math Definitions886402
-Ref: table-ieee-formats889697
-Ref: Math Definitions-Footnote-1890301
-Node: MPFR features890406
-Node: FP Math Caution892077
-Ref: FP Math Caution-Footnote-1893127
-Node: Inexactness of computations893496
-Node: Inexact representation894455
-Node: Comparing FP Values895813
-Node: Errors accumulate896895
-Node: Getting Accuracy898327
-Node: Try To Round901031
-Node: Setting precision901930
-Ref: table-predefined-precision-strings902614
-Node: Setting the rounding mode904443
-Ref: table-gawk-rounding-modes904807
-Ref: Setting the rounding mode-Footnote-1908259
-Node: Arbitrary Precision Integers908438
-Ref: Arbitrary Precision Integers-Footnote-1913336
-Node: POSIX Floating Point Problems913485
-Ref: POSIX Floating Point Problems-Footnote-1917364
-Node: Floating point summary917402
-Node: Dynamic Extensions919589
-Node: Extension Intro921141
-Node: Plugin License922406
-Node: Extension Mechanism Outline923203
-Ref: figure-load-extension923631
-Ref: figure-register-new-function925111
-Ref: figure-call-new-function926115
-Node: Extension API Description928102
-Node: Extension API Functions Introduction929552
-Node: General Data Types934373
-Ref: General Data Types-Footnote-1940273
-Node: Memory Allocation Functions940572
-Ref: Memory Allocation Functions-Footnote-1943411
-Node: Constructor Functions943510
-Node: Registration Functions945249
-Node: Extension Functions945934
-Node: Exit Callback Functions948231
-Node: Extension Version String949479
-Node: Input Parsers950142
-Node: Output Wrappers960017
-Node: Two-way processors964530
-Node: Printing Messages966793
-Ref: Printing Messages-Footnote-1967869
-Node: Updating `ERRNO'968021
-Node: Requesting Values968761
-Ref: table-value-types-returned969488
-Node: Accessing Parameters970445
-Node: Symbol Table Access971679
-Node: Symbol table by name972193
-Node: Symbol table by cookie974213
-Ref: Symbol table by cookie-Footnote-1978358
-Node: Cached values978421
-Ref: Cached values-Footnote-1981917
-Node: Array Manipulation982008
-Ref: Array Manipulation-Footnote-1983106
-Node: Array Data Types983143
-Ref: Array Data Types-Footnote-1985798
-Node: Array Functions985890
-Node: Flattening Arrays989749
-Node: Creating Arrays996651
-Node: Extension API Variables1001422
-Node: Extension Versioning1002058
-Node: Extension API Informational Variables1003949
-Node: Extension API Boilerplate1005014
-Node: Finding Extensions1008823
-Node: Extension Example1009383
-Node: Internal File Description1010155
-Node: Internal File Ops1014222
-Ref: Internal File Ops-Footnote-11025973
-Node: Using Internal File Ops1026113
-Ref: Using Internal File Ops-Footnote-11028496
-Node: Extension Samples1028769
-Node: Extension Sample File Functions1030297
-Node: Extension Sample Fnmatch1037978
-Node: Extension Sample Fork1039466
-Node: Extension Sample Inplace1040681
-Node: Extension Sample Ord1042357
-Node: Extension Sample Readdir1043193
-Ref: table-readdir-file-types1044070
-Node: Extension Sample Revout1044881
-Node: Extension Sample Rev2way1045470
-Node: Extension Sample Read write array1046210
-Node: Extension Sample Readfile1048150
-Node: Extension Sample Time1049245
-Node: Extension Sample API Tests1050593
-Node: gawkextlib1051084
-Node: Extension summary1053762
-Node: Extension Exercises1057451
-Node: Language History1058173
-Node: V7/SVR3.11059829
-Node: SVR41061982
-Node: POSIX1063416
-Node: BTL1064797
-Node: POSIX/GNU1065528
-Node: Feature History1071364
-Node: Common Extensions1085158
-Node: Ranges and Locales1086530
-Ref: Ranges and Locales-Footnote-11091149
-Ref: Ranges and Locales-Footnote-21091176
-Ref: Ranges and Locales-Footnote-31091411
-Node: Contributors1091632
-Node: History summary1097172
-Node: Installation1098551
-Node: Gawk Distribution1099497
-Node: Getting1099981
-Node: Extracting1100804
-Node: Distribution contents1102441
-Node: Unix Installation1108543
-Node: Quick Installation1109226
-Node: Shell Startup Files1111637
-Node: Additional Configuration Options1112716
-Node: Configuration Philosophy1114520
-Node: Non-Unix Installation1116889
-Node: PC Installation1117347
-Node: PC Binary Installation1118667
-Node: PC Compiling1120515
-Ref: PC Compiling-Footnote-11123536
-Node: PC Testing1123645
-Node: PC Using1124821
-Node: Cygwin1128936
-Node: MSYS1129706
-Node: VMS Installation1130207
-Node: VMS Compilation1130999
-Ref: VMS Compilation-Footnote-11132228
-Node: VMS Dynamic Extensions1132286
-Node: VMS Installation Details1133970
-Node: VMS Running1136221
-Node: VMS GNV1139061
-Node: VMS Old Gawk1139796
-Node: Bugs1140266
-Node: Other Versions1144155
-Node: Installation summary1150589
-Node: Notes1151648
-Node: Compatibility Mode1152513
-Node: Additions1153295
-Node: Accessing The Source1154220
-Node: Adding Code1155655
-Node: New Ports1161812
-Node: Derived Files1166294
-Ref: Derived Files-Footnote-11171769
-Ref: Derived Files-Footnote-21171803
-Ref: Derived Files-Footnote-31172399
-Node: Future Extensions1172513
-Node: Implementation Limitations1173119
-Node: Extension Design1174367
-Node: Old Extension Problems1175521
-Ref: Old Extension Problems-Footnote-11177038
-Node: Extension New Mechanism Goals1177095
-Ref: Extension New Mechanism Goals-Footnote-11180455
-Node: Extension Other Design Decisions1180644
-Node: Extension Future Growth1182752
-Node: Old Extension Mechanism1183588
-Node: Notes summary1185350
-Node: Basic Concepts1186536
-Node: Basic High Level1187217
-Ref: figure-general-flow1187489
-Ref: figure-process-flow1188088
-Ref: Basic High Level-Footnote-11191317
-Node: Basic Data Typing1191502
-Node: Glossary1194830
-Node: Copying1226759
-Node: GNU Free Documentation License1264315
-Node: Index1289451
+Node: Splitting By Content232493
+Ref: Splitting By Content-Footnote-1236458
+Node: Multiple Line236621
+Ref: Multiple Line-Footnote-1242502
+Node: Getline242681
+Node: Plain Getline244888
+Node: Getline/Variable247528
+Node: Getline/File248677
+Node: Getline/Variable/File250062
+Ref: Getline/Variable/File-Footnote-1251665
+Node: Getline/Pipe251752
+Node: Getline/Variable/Pipe254430
+Node: Getline/Coprocess255561
+Node: Getline/Variable/Coprocess256825
+Node: Getline Notes257564
+Node: Getline Summary260358
+Ref: table-getline-variants260770
+Node: Read Timeout261599
+Ref: Read Timeout-Footnote-1265436
+Node: Command-line directories265494
+Node: Input Summary266399
+Node: Input Exercises269784
+Node: Printing270512
+Node: Print272347
+Node: Print Examples273804
+Node: Output Separators276583
+Node: OFMT278601
+Node: Printf279956
+Node: Basic Printf280741
+Node: Control Letters282313
+Node: Format Modifiers286298
+Node: Printf Examples292304
+Node: Redirection294790
+Node: Special FD301628
+Ref: Special FD-Footnote-1304794
+Node: Special Files304868
+Node: Other Inherited Files305485
+Node: Special Network306485
+Node: Special Caveats307347
+Node: Close Files And Pipes308296
+Ref: Close Files And Pipes-Footnote-1315481
+Ref: Close Files And Pipes-Footnote-2315629
+Node: Nonfatal315779
+Node: Output Summary318104
+Node: Output Exercises319325
+Node: Expressions320005
+Node: Values321194
+Node: Constants321871
+Node: Scalar Constants322562
+Ref: Scalar Constants-Footnote-1323424
+Node: Nondecimal-numbers323674
+Node: Regexp Constants326684
+Node: Using Constant Regexps327210
+Node: Variables330373
+Node: Using Variables331030
+Node: Assignment Options332941
+Node: Conversion334816
+Node: Strings And Numbers335340
+Ref: Strings And Numbers-Footnote-1338405
+Node: Locale influences conversions338514
+Ref: table-locale-affects341260
+Node: All Operators341852
+Node: Arithmetic Ops342481
+Node: Concatenation344986
+Ref: Concatenation-Footnote-1347805
+Node: Assignment Ops347912
+Ref: table-assign-ops352891
+Node: Increment Ops354201
+Node: Truth Values and Conditions357632
+Node: Truth Values358715
+Node: Typing and Comparison359764
+Node: Variable Typing360580
+Node: Comparison Operators364247
+Ref: table-relational-ops364657
+Node: POSIX String Comparison368152
+Ref: POSIX String Comparison-Footnote-1369224
+Node: Boolean Ops369363
+Ref: Boolean Ops-Footnote-1373841
+Node: Conditional Exp373932
+Node: Function Calls375670
+Node: Precedence379550
+Node: Locales383210
+Node: Expressions Summary384842
+Node: Patterns and Actions387413
+Node: Pattern Overview388533
+Node: Regexp Patterns390212
+Node: Expression Patterns390755
+Node: Ranges394535
+Node: BEGIN/END397642
+Node: Using BEGIN/END398403
+Ref: Using BEGIN/END-Footnote-1401139
+Node: I/O And BEGIN/END401245
+Node: BEGINFILE/ENDFILE403560
+Node: Empty406457
+Node: Using Shell Variables406774
+Node: Action Overview409047
+Node: Statements411373
+Node: If Statement413221
+Node: While Statement414716
+Node: Do Statement416744
+Node: For Statement417892
+Node: Switch Statement421050
+Node: Break Statement423432
+Node: Continue Statement425525
+Node: Next Statement427352
+Node: Nextfile Statement429733
+Node: Exit Statement432361
+Node: Built-in Variables434772
+Node: User-modified435905
+Ref: User-modified-Footnote-1443539
+Node: Auto-set443601
+Ref: Auto-set-Footnote-1457310
+Ref: Auto-set-Footnote-2457515
+Node: ARGC and ARGV457571
+Node: Pattern Action Summary461789
+Node: Arrays464222
+Node: Array Basics465551
+Node: Array Intro466395
+Ref: figure-array-elements468332
+Ref: Array Intro-Footnote-1470955
+Node: Reference to Elements471083
+Node: Assigning Elements473545
+Node: Array Example474036
+Node: Scanning an Array475795
+Node: Controlling Scanning478818
+Ref: Controlling Scanning-Footnote-1484212
+Node: Numeric Array Subscripts484528
+Node: Uninitialized Subscripts486713
+Node: Delete488330
+Ref: Delete-Footnote-1491079
+Node: Multidimensional491136
+Node: Multiscanning494233
+Node: Arrays of Arrays495822
+Node: Arrays Summary500576
+Node: Functions502667
+Node: Built-in503706
+Node: Calling Built-in504784
+Node: Numeric Functions506779
+Ref: Numeric Functions-Footnote-1511597
+Ref: Numeric Functions-Footnote-2511954
+Ref: Numeric Functions-Footnote-3512002
+Node: String Functions512274
+Ref: String Functions-Footnote-1535775
+Ref: String Functions-Footnote-2535904
+Ref: String Functions-Footnote-3536152
+Node: Gory Details536239
+Ref: table-sub-escapes538020
+Ref: table-sub-proposed539535
+Ref: table-posix-sub540897
+Ref: table-gensub-escapes542434
+Ref: Gory Details-Footnote-1543267
+Node: I/O Functions543418
+Ref: I/O Functions-Footnote-1550654
+Node: Time Functions550801
+Ref: Time Functions-Footnote-1561310
+Ref: Time Functions-Footnote-2561378
+Ref: Time Functions-Footnote-3561536
+Ref: Time Functions-Footnote-4561647
+Ref: Time Functions-Footnote-5561759
+Ref: Time Functions-Footnote-6561986
+Node: Bitwise Functions562252
+Ref: table-bitwise-ops562814
+Ref: Bitwise Functions-Footnote-1567142
+Node: Type Functions567314
+Node: I18N Functions568466
+Node: User-defined570113
+Node: Definition Syntax570918
+Ref: Definition Syntax-Footnote-1576577
+Node: Function Example576648
+Ref: Function Example-Footnote-1579569
+Node: Function Caveats579591
+Node: Calling A Function580109
+Node: Variable Scope581067
+Node: Pass By Value/Reference584060
+Node: Return Statement587557
+Node: Dynamic Typing590536
+Node: Indirect Calls591465
+Ref: Indirect Calls-Footnote-1601330
+Node: Functions Summary601458
+Node: Library Functions604160
+Ref: Library Functions-Footnote-1607768
+Ref: Library Functions-Footnote-2607911
+Node: Library Names608082
+Ref: Library Names-Footnote-1611540
+Ref: Library Names-Footnote-2611763
+Node: General Functions611849
+Node: Strtonum Function612952
+Node: Assert Function615974
+Node: Round Function619298
+Node: Cliff Random Function620839
+Node: Ordinal Functions621855
+Ref: Ordinal Functions-Footnote-1624918
+Ref: Ordinal Functions-Footnote-2625170
+Node: Join Function625381
+Ref: Join Function-Footnote-1627151
+Node: Getlocaltime Function627351
+Node: Readfile Function631095
+Node: Shell Quoting633067
+Node: Data File Management634468
+Node: Filetrans Function635100
+Node: Rewind Function639196
+Node: File Checking640582
+Ref: File Checking-Footnote-1641915
+Node: Empty Files642116
+Node: Ignoring Assigns644095
+Node: Getopt Function645645
+Ref: Getopt Function-Footnote-1657109
+Node: Passwd Functions657309
+Ref: Passwd Functions-Footnote-1666149
+Node: Group Functions666237
+Ref: Group Functions-Footnote-1674134
+Node: Walking Arrays674339
+Node: Library Functions Summary677345
+Node: Library Exercises678747
+Node: Sample Programs680027
+Node: Running Examples680797
+Node: Clones681525
+Node: Cut Program682749
+Node: Egrep Program692469
+Ref: Egrep Program-Footnote-1699972
+Node: Id Program700082
+Node: Split Program703758
+Ref: Split Program-Footnote-1707212
+Node: Tee Program707340
+Node: Uniq Program710129
+Node: Wc Program717548
+Ref: Wc Program-Footnote-1721798
+Node: Miscellaneous Programs721892
+Node: Dupword Program723105
+Node: Alarm Program725136
+Node: Translate Program729941
+Ref: Translate Program-Footnote-1734504
+Node: Labels Program734774
+Ref: Labels Program-Footnote-1738125
+Node: Word Sorting738209
+Node: History Sorting742279
+Node: Extract Program744114
+Node: Simple Sed751638
+Node: Igawk Program754708
+Ref: Igawk Program-Footnote-1769034
+Ref: Igawk Program-Footnote-2769235
+Ref: Igawk Program-Footnote-3769357
+Node: Anagram Program769472
+Node: Signature Program772533
+Node: Programs Summary773780
+Node: Programs Exercises775001
+Ref: Programs Exercises-Footnote-1779132
+Node: Advanced Features779223
+Node: Nondecimal Data781205
+Node: Array Sorting782795
+Node: Controlling Array Traversal783495
+Ref: Controlling Array Traversal-Footnote-1791861
+Node: Array Sorting Functions791979
+Ref: Array Sorting Functions-Footnote-1795865
+Node: Two-way I/O796061
+Ref: Two-way I/O-Footnote-1801006
+Ref: Two-way I/O-Footnote-2801192
+Node: TCP/IP Networking801274
+Node: Profiling804146
+Node: Advanced Features Summary812417
+Node: Internationalization814350
+Node: I18N and L10N815830
+Node: Explaining gettext816516
+Ref: Explaining gettext-Footnote-1821541
+Ref: Explaining gettext-Footnote-2821725
+Node: Programmer i18n821890
+Ref: Programmer i18n-Footnote-1826766
+Node: Translator i18n826815
+Node: String Extraction827609
+Ref: String Extraction-Footnote-1828740
+Node: Printf Ordering828826
+Ref: Printf Ordering-Footnote-1831612
+Node: I18N Portability831676
+Ref: I18N Portability-Footnote-1834132
+Node: I18N Example834195
+Ref: I18N Example-Footnote-1836998
+Node: Gawk I18N837070
+Node: I18N Summary837714
+Node: Debugger839054
+Node: Debugging840076
+Node: Debugging Concepts840517
+Node: Debugging Terms842327
+Node: Awk Debugging844899
+Node: Sample Debugging Session845805
+Node: Debugger Invocation846339
+Node: Finding The Bug847724
+Node: List of Debugger Commands854203
+Node: Breakpoint Control855535
+Node: Debugger Execution Control859212
+Node: Viewing And Changing Data862571
+Node: Execution Stack865947
+Node: Debugger Info867582
+Node: Miscellaneous Debugger Commands871627
+Node: Readline Support876628
+Node: Limitations877522
+Node: Debugging Summary879637
+Node: Arbitrary Precision Arithmetic880811
+Node: Computer Arithmetic882227
+Ref: table-numeric-ranges885804
+Ref: Computer Arithmetic-Footnote-1886328
+Node: Math Definitions886385
+Ref: table-ieee-formats889680
+Ref: Math Definitions-Footnote-1890284
+Node: MPFR features890389
+Node: FP Math Caution892060
+Ref: FP Math Caution-Footnote-1893110
+Node: Inexactness of computations893479
+Node: Inexact representation894438
+Node: Comparing FP Values895796
+Node: Errors accumulate896878
+Node: Getting Accuracy898310
+Node: Try To Round901014
+Node: Setting precision901913
+Ref: table-predefined-precision-strings902597
+Node: Setting the rounding mode904426
+Ref: table-gawk-rounding-modes904790
+Ref: Setting the rounding mode-Footnote-1908242
+Node: Arbitrary Precision Integers908421
+Ref: Arbitrary Precision Integers-Footnote-1913319
+Node: POSIX Floating Point Problems913468
+Ref: POSIX Floating Point Problems-Footnote-1917347
+Node: Floating point summary917385
+Node: Dynamic Extensions919572
+Node: Extension Intro921124
+Node: Plugin License922389
+Node: Extension Mechanism Outline923186
+Ref: figure-load-extension923614
+Ref: figure-register-new-function925094
+Ref: figure-call-new-function926098
+Node: Extension API Description928085
+Node: Extension API Functions Introduction929535
+Node: General Data Types934356
+Ref: General Data Types-Footnote-1940256
+Node: Memory Allocation Functions940555
+Ref: Memory Allocation Functions-Footnote-1943394
+Node: Constructor Functions943493
+Node: Registration Functions945232
+Node: Extension Functions945917
+Node: Exit Callback Functions948214
+Node: Extension Version String949462
+Node: Input Parsers950125
+Node: Output Wrappers960000
+Node: Two-way processors964513
+Node: Printing Messages966776
+Ref: Printing Messages-Footnote-1967852
+Node: Updating `ERRNO'968004
+Node: Requesting Values968744
+Ref: table-value-types-returned969471
+Node: Accessing Parameters970428
+Node: Symbol Table Access971662
+Node: Symbol table by name972176
+Node: Symbol table by cookie974196
+Ref: Symbol table by cookie-Footnote-1978341
+Node: Cached values978404
+Ref: Cached values-Footnote-1981900
+Node: Array Manipulation981991
+Ref: Array Manipulation-Footnote-1983089
+Node: Array Data Types983126
+Ref: Array Data Types-Footnote-1985781
+Node: Array Functions985873
+Node: Flattening Arrays989732
+Node: Creating Arrays996634
+Node: Extension API Variables1001405
+Node: Extension Versioning1002041
+Node: Extension API Informational Variables1003932
+Node: Extension API Boilerplate1004997
+Node: Finding Extensions1008806
+Node: Extension Example1009366
+Node: Internal File Description1010138
+Node: Internal File Ops1014205
+Ref: Internal File Ops-Footnote-11025956
+Node: Using Internal File Ops1026096
+Ref: Using Internal File Ops-Footnote-11028479
+Node: Extension Samples1028752
+Node: Extension Sample File Functions1030280
+Node: Extension Sample Fnmatch1037961
+Node: Extension Sample Fork1039449
+Node: Extension Sample Inplace1040664
+Node: Extension Sample Ord1042340
+Node: Extension Sample Readdir1043176
+Ref: table-readdir-file-types1044053
+Node: Extension Sample Revout1044864
+Node: Extension Sample Rev2way1045453
+Node: Extension Sample Read write array1046193
+Node: Extension Sample Readfile1048133
+Node: Extension Sample Time1049228
+Node: Extension Sample API Tests1050576
+Node: gawkextlib1051067
+Node: Extension summary1053745
+Node: Extension Exercises1057434
+Node: Language History1058156
+Node: V7/SVR3.11059812
+Node: SVR41061965
+Node: POSIX1063399
+Node: BTL1064780
+Node: POSIX/GNU1065511
+Node: Feature History1071347
+Node: Common Extensions1085141
+Node: Ranges and Locales1086513
+Ref: Ranges and Locales-Footnote-11091132
+Ref: Ranges and Locales-Footnote-21091159
+Ref: Ranges and Locales-Footnote-31091394
+Node: Contributors1091615
+Node: History summary1097155
+Node: Installation1098534
+Node: Gawk Distribution1099480
+Node: Getting1099964
+Node: Extracting1100787
+Node: Distribution contents1102424
+Node: Unix Installation1108526
+Node: Quick Installation1109209
+Node: Shell Startup Files1111620
+Node: Additional Configuration Options1112699
+Node: Configuration Philosophy1114503
+Node: Non-Unix Installation1116872
+Node: PC Installation1117330
+Node: PC Binary Installation1118650
+Node: PC Compiling1120498
+Ref: PC Compiling-Footnote-11123519
+Node: PC Testing1123628
+Node: PC Using1124804
+Node: Cygwin1128919
+Node: MSYS1129689
+Node: VMS Installation1130190
+Node: VMS Compilation1130982
+Ref: VMS Compilation-Footnote-11132211
+Node: VMS Dynamic Extensions1132269
+Node: VMS Installation Details1133953
+Node: VMS Running1136204
+Node: VMS GNV1139044
+Node: VMS Old Gawk1139779
+Node: Bugs1140249
+Node: Other Versions1144138
+Node: Installation summary1150572
+Node: Notes1151631
+Node: Compatibility Mode1152496
+Node: Additions1153278
+Node: Accessing The Source1154203
+Node: Adding Code1155638
+Node: New Ports1161795
+Node: Derived Files1166277
+Ref: Derived Files-Footnote-11171752
+Ref: Derived Files-Footnote-21171786
+Ref: Derived Files-Footnote-31172382
+Node: Future Extensions1172496
+Node: Implementation Limitations1173102
+Node: Extension Design1174350
+Node: Old Extension Problems1175504
+Ref: Old Extension Problems-Footnote-11177021
+Node: Extension New Mechanism Goals1177078
+Ref: Extension New Mechanism Goals-Footnote-11180438
+Node: Extension Other Design Decisions1180627
+Node: Extension Future Growth1182735
+Node: Old Extension Mechanism1183571
+Node: Notes summary1185333
+Node: Basic Concepts1186519
+Node: Basic High Level1187200
+Ref: figure-general-flow1187472
+Ref: figure-process-flow1188071
+Ref: Basic High Level-Footnote-11191300
+Node: Basic Data Typing1191485
+Node: Glossary1194813
+Node: Copying1226742
+Node: GNU Free Documentation License1264298
+Node: Index1289434

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 615330d1..27cbcab2 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -7675,7 +7675,7 @@ variable @code{FIELDWIDTHS}. Each number specifies the width of the field,
@emph{including} columns between fields. If you want to ignore the columns
between fields, you can specify the width as a separate field that is
subsequently ignored.
-It is a fatal error to supply a field width that is not a positive number.
+It is a fatal error to supply a field width that has a negative value.
The following data is the output of the Unix @command{w} utility. It is useful
to illustrate the use of @code{FIELDWIDTHS}:
@@ -15586,7 +15586,7 @@ In most other languages, arrays must be @dfn{declared} before use,
including a specification of
how many elements or components they contain. In such languages, the
declaration causes a contiguous block of memory to be allocated for that
-many elements. Usually, an index in the array must be a positive integer.
+many elements. Usually, an index in the array must be a nonnegative integer.
For example, the index zero specifies the first element in the array, which is
actually stored at the beginning of the block of memory. Index one
specifies the second element, which is stored in memory right after the
@@ -15766,7 +15766,7 @@ Now the array is @dfn{sparse}, which just means some indices are missing.
It has elements 0--3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or 9.
Another consequence of associative arrays is that the indices don't
-have to be positive integers. Any number, or even a string, can be
+have to be nonnegative integers. Any number, or even a string, can be
an index. For example, the following is an array that translates words from
English to French:
@@ -16029,7 +16029,7 @@ END @{
In programs that use arrays, it is often necessary to use a loop that
executes once for each element of an array. In other languages, where
-arrays are contiguous and indices are limited to positive integers,
+arrays are contiguous and indices are limited to nonnegative integers,
this is easy: all the valid indices can be found by counting from
the lowest index up to the highest. This technique won't do the job
in @command{awk}, because any number or string can be an array index.
@@ -30287,8 +30287,8 @@ The disadvantage is that their range is limited.
@cindex integers, unsigned
In computers, integer values come in two flavors: @dfn{signed} and
@dfn{unsigned}. Signed values may be negative or positive, whereas
-unsigned values are always positive (i.e., greater than or equal
-to zero).
+unsigned values are always greater than or equal
+to zero.
In computer systems, integer arithmetic is exact, but the possible
range of values is limited. Integer arithmetic is generally faster than
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 8612876e..121a066e 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -7275,7 +7275,7 @@ variable @code{FIELDWIDTHS}. Each number specifies the width of the field,
@emph{including} columns between fields. If you want to ignore the columns
between fields, you can specify the width as a separate field that is
subsequently ignored.
-It is a fatal error to supply a field width that is not a positive number.
+It is a fatal error to supply a field width that has a negative value.
The following data is the output of the Unix @command{w} utility. It is useful
to illustrate the use of @code{FIELDWIDTHS}:
@@ -14868,7 +14868,7 @@ In most other languages, arrays must be @dfn{declared} before use,
including a specification of
how many elements or components they contain. In such languages, the
declaration causes a contiguous block of memory to be allocated for that
-many elements. Usually, an index in the array must be a positive integer.
+many elements. Usually, an index in the array must be a nonnegative integer.
For example, the index zero specifies the first element in the array, which is
actually stored at the beginning of the block of memory. Index one
specifies the second element, which is stored in memory right after the
@@ -15048,7 +15048,7 @@ Now the array is @dfn{sparse}, which just means some indices are missing.
It has elements 0--3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or 9.
Another consequence of associative arrays is that the indices don't
-have to be positive integers. Any number, or even a string, can be
+have to be nonnegative integers. Any number, or even a string, can be
an index. For example, the following is an array that translates words from
English to French:
@@ -15311,7 +15311,7 @@ END @{
In programs that use arrays, it is often necessary to use a loop that
executes once for each element of an array. In other languages, where
-arrays are contiguous and indices are limited to positive integers,
+arrays are contiguous and indices are limited to nonnegative integers,
this is easy: all the valid indices can be found by counting from
the lowest index up to the highest. This technique won't do the job
in @command{awk}, because any number or string can be an array index.
@@ -29378,8 +29378,8 @@ The disadvantage is that their range is limited.
@cindex integers, unsigned
In computers, integer values come in two flavors: @dfn{signed} and
@dfn{unsigned}. Signed values may be negative or positive, whereas
-unsigned values are always positive (i.e., greater than or equal
-to zero).
+unsigned values are always greater than or equal
+to zero.
In computer systems, integer arithmetic is exact, but the possible
range of values is limited. Integer arithmetic is generally faster than
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 749871dc..9d7e6173 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * inplace.c (do_inplace_begin): Jump through more hoops to satisfy
+ a newer version of clang.
+ * inplace.3am (BUGS): Add new section and documentation.
+
2015-02-26 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): Add rwarray0.c to the list.
diff --git a/extension/inplace.3am b/extension/inplace.3am
index 5ca04be2..d6339c4a 100644
--- a/extension/inplace.3am
+++ b/extension/inplace.3am
@@ -1,4 +1,4 @@
-.TH INPLACE 3am "Jan 15 2013" "Free Software Foundation" "GNU Awk Extension Modules"
+.TH INPLACE 3am "Mar 16 2015" "Free Software Foundation" "GNU Awk Extension Modules"
.SH NAME
inplace \- emulate sed/perl/ruby in-place editing
.SH SYNOPSIS
@@ -45,7 +45,10 @@ extension concatenates that suffix onto the original
filename and uses the result as a filename for renaming
the original.
... .SH NOTES
-... .SH BUGS
+.SH BUGS
+As currently written, output from an \f(CWENDFILE\fP
+rule does not get redirected into the replacement file.
+Neither does output from an \f(CWEND\fP rule.
.SH EXAMPLE
.ft CW
.nf
diff --git a/extension/inplace.c b/extension/inplace.c
index 0693ad92..e3685e30 100644
--- a/extension/inplace.c
+++ b/extension/inplace.c
@@ -171,10 +171,10 @@ do_inplace_begin(int nargs, awk_value_t *result)
/* N.B. chown/chmod should be more portable than fchown/fchmod */
if (chown(state.tname, sbuf.st_uid, sbuf.st_gid) < 0) {
- /* jumping through hoops to silence gcc. :-( */
+ /* jumping through hoops to silence gcc and clang. :-( */
int junk;
junk = chown(state.tname, -1, sbuf.st_gid);
- junk = junk;
+ ++junk;
}
if (chmod(state.tname, sbuf.st_mode) < 0)
diff --git a/profile.c b/profile.c
index 2cb9e159..3e9ef783 100644
--- a/profile.c
+++ b/profile.c
@@ -1390,16 +1390,30 @@ pp_number(NODE *n)
{
#define PP_PRECISION 6
char *str;
+ size_t count;
- emalloc(str, char *, PP_PRECISION + 10, "pp_number");
#ifdef HAVE_MPFR
- if (is_mpg_float(n))
- mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr);
- else if (is_mpg_integer(n))
+ if (is_mpg_float(n)) {
+ count = mpfr_get_prec(n->mpg_numbr) / 3; /* ~ 3.22 binary digits per decimal digit */
+ emalloc(str, char *, count, "pp_number");
+ /*
+ * 3/2015: Format string used to be "%0.*R*g". That padded
+ * with leading zeros. But it doesn't do that for regular
+ * numbers in the non-MPFR case.
+ */
+ mpfr_sprintf(str, "%.*R*g", PP_PRECISION, ROUND_MODE, n->mpg_numbr);
+ } else if (is_mpg_integer(n)) {
+ count = mpz_sizeinbase(n->mpg_i, 10) + 2; /* +1 for sign, +1 for NUL at end */
+ emalloc(str, char *, count, "pp_number");
mpfr_sprintf(str, "%Zd", n->mpg_i);
- else
+ } else
#endif
- sprintf(str, "%0.*g", PP_PRECISION, n->numbr);
+ {
+ count = PP_PRECISION + 10;
+ emalloc(str, char *, count, "pp_number");
+ sprintf(str, "%0.*g", PP_PRECISION, n->numbr);
+ }
+
return str;
#undef PP_PRECISION
}
diff --git a/test/ChangeLog b/test/ChangeLog
index af980ca0..e9848c4b 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-17 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (mpfrmemok1): New test.
+ * mpfrmemok1.awk, mpfrmemok1.ok: New files.
+
2015-03-10 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (fpat4): New test.
diff --git a/test/Makefile.am b/test/Makefile.am
index ec8ed1c4..d2cd0ddd 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -537,6 +537,8 @@ EXTRA_DIST = \
mpfrexprange.ok \
mpfrieee.awk \
mpfrieee.ok \
+ mpfrmemok1.awk \
+ mpfrmemok1.ok \
mpfrnegzero.awk \
mpfrnegzero.ok \
mpfrnr.awk \
@@ -1071,8 +1073,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
-MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \
- mpfrsort mpfrsqrt mpfrbigint
+MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \
+ mpfrexprange mpfrsort mpfrsqrt mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti backbigs1 backsmalls1 backsmalls2 \
@@ -1828,6 +1830,11 @@ mpfrrem:
@$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrmemok1:
+ @echo $@
+ @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
jarebug::
@echo $@
@"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
diff --git a/test/Makefile.in b/test/Makefile.in
index 42cc5c3d..cf8093b8 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -794,6 +794,8 @@ EXTRA_DIST = \
mpfrexprange.ok \
mpfrieee.awk \
mpfrieee.ok \
+ mpfrmemok1.awk \
+ mpfrmemok1.ok \
mpfrnegzero.awk \
mpfrnegzero.ok \
mpfrnr.awk \
@@ -1324,8 +1326,8 @@ GAWK_EXT_TESTS = \
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
-MPFR_TESTS = mpfrnr mpfrnegzero mpfrrem mpfrrnd mpfrieee mpfrexprange \
- mpfrsort mpfrsqrt mpfrbigint
+MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \
+ mpfrexprange mpfrsort mpfrsqrt mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti backbigs1 backsmalls1 backsmalls2 \
@@ -2265,6 +2267,11 @@ mpfrrem:
@$(AWK) -M -f "$(srcdir)"/$@.awk > _$@ 2>&1
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrmemok1:
+ @echo $@
+ @$(AWK) -p/dev/stdout -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
jarebug::
@echo $@
@"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
diff --git a/test/mpfrmemok1.awk b/test/mpfrmemok1.awk
new file mode 100644
index 00000000..9331a34d
--- /dev/null
+++ b/test/mpfrmemok1.awk
@@ -0,0 +1,7 @@
+# This program tests that -M works with profiling.
+# It does not do anything real, but there should not be glibc memory
+# errors and it should be valgrind-clean too.
+
+BEGIN {
+ v = 0x0100000000000000000000000000000000
+}
diff --git a/test/mpfrmemok1.ok b/test/mpfrmemok1.ok
new file mode 100644
index 00000000..2389a2d5
--- /dev/null
+++ b/test/mpfrmemok1.ok
@@ -0,0 +1,7 @@
+
+ # BEGIN rule(s)
+
+ BEGIN {
+ 1 v = 340282366920938463463374607431768211456
+ }
+