aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-25 21:38:10 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-10-25 21:38:10 +0300
commita90f46df6a98818c99abfe4c4e0b738cb845294e (patch)
tree0c1376250f9a89d5f89691c99a04cf9c1a94615b
parent587bf3c557fde9fa62a638600d002ddb4afc47a6 (diff)
downloadegawk-a90f46df6a98818c99abfe4c4e0b738cb845294e.tar.gz
egawk-a90f46df6a98818c99abfe4c4e0b738cb845294e.tar.bz2
egawk-a90f46df6a98818c99abfe4c4e0b738cb845294e.zip
Disallow negative arguments to bitwise functions. Document same.
-rw-r--r--ChangeLog9
-rw-r--r--NEWS3
-rw-r--r--builtin.c35
-rw-r--r--doc/ChangeLog7
-rw-r--r--doc/gawk.15
-rw-r--r--doc/gawk.info692
-rw-r--r--doc/gawk.texi134
-rw-r--r--doc/gawktexi.in66
-rw-r--r--mpfr.c33
9 files changed, 616 insertions, 368 deletions
diff --git a/ChangeLog b/ChangeLog
index cb636b7e..8209cdc8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-10-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ Disallow negative arguments to the bitwise functions.
+
+ * NEWS: Document this.
+ * builtin.c (do_lshift, do_rshift, do_and, do_or, do_xor, do_compl):
+ Make negative arguments a fatal error.
+ * mpfr.c (do_mpfr_compl, get_intval): Ditto.
+
2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
* General: Remove trailing whitespace from all relevant files.
diff --git a/NEWS b/NEWS
index 1d844966..a06db845 100644
--- a/NEWS
+++ b/NEWS
@@ -82,6 +82,9 @@ Changes from 4.1.x to 4.2.0
21. Pretty printing now uses the original text of constant numeric values for
pretty printing and profiling.
+22. Passing negative operands to any of the bitwise functions now
+ produces a fatal error.
+
Changes from 4.1.3 to 4.1.4
---------------------------
diff --git a/builtin.c b/builtin.c
index 2b93189b..5b6e3755 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3334,11 +3334,13 @@ do_lshift(int nargs)
if ((fixtype(s2)->flags & NUMBER) == 0)
lintwarn(_("lshift: received non-numeric second argument"));
}
+
val = force_number(s1)->numbr;
shift = force_number(s2)->numbr;
+ if (val < 0 || shift < 0)
+ fatal(_("lshift(%f, %f): negative values are not allowed"), val, shift);
+
if (do_lint) {
- if (val < 0 || shift < 0)
- lintwarn(_("lshift(%f, %f): negative values will give strange results"), val, shift);
if (double_to_int(val) != val || double_to_int(shift) != shift)
lintwarn(_("lshift(%f, %f): fractional values will be truncated"), val, shift);
if (shift >= sizeof(uintmax_t) * CHAR_BIT)
@@ -3371,11 +3373,13 @@ do_rshift(int nargs)
if ((fixtype(s2)->flags & NUMBER) == 0)
lintwarn(_("rshift: received non-numeric second argument"));
}
+
val = force_number(s1)->numbr;
shift = force_number(s2)->numbr;
+ if (val < 0 || shift < 0)
+ fatal(_("rshift(%f, %f): negative values are not allowed"), val, shift);
+
if (do_lint) {
- if (val < 0 || shift < 0)
- lintwarn(_("rshift(%f, %f): negative values will give strange results"), val, shift);
if (double_to_int(val) != val || double_to_int(shift) != shift)
lintwarn(_("rshift(%f, %f): fractional values will be truncated"), val, shift);
if (shift >= sizeof(uintmax_t) * CHAR_BIT)
@@ -3412,8 +3416,8 @@ do_and(int nargs)
lintwarn(_("and: argument %d is non-numeric"), i);
val = force_number(s1)->numbr;
- if (do_lint && val < 0)
- lintwarn(_("and: argument %d negative value %g will give strange results"), i, val);
+ if (val < 0)
+ fatal(_("and: argument %d negative value %g is not allowed"), i, val);
uval = (uintmax_t) val;
res &= uval;
@@ -3444,8 +3448,8 @@ do_or(int nargs)
lintwarn(_("or: argument %d is non-numeric"), i);
val = force_number(s1)->numbr;
- if (do_lint && val < 0)
- lintwarn(_("or: argument %d negative value %g will give strange results"), i, val);
+ if (val < 0)
+ fatal(_("or: argument %d negative value %g is not allowed"), i, val);
uval = (uintmax_t) val;
res |= uval;
@@ -3476,8 +3480,8 @@ do_xor(int nargs)
lintwarn(_("xor: argument %d is non-numeric"), i);
val = force_number(s1)->numbr;
- if (do_lint && val < 0)
- lintwarn(_("xor: argument %d negative value %g will give strange results"), i, val);
+ if (val < 0)
+ fatal(_("xor: argument %d negative value %g is not allowed"), i, val);
uval = (uintmax_t) val;
if (i == 1)
@@ -3506,12 +3510,11 @@ do_compl(int nargs)
d = force_number(tmp)->numbr;
DEREF(tmp);
- if (do_lint) {
- if (d < 0)
- lintwarn(_("compl(%f): negative value will give strange results"), d);
- if (double_to_int(d) != d)
- lintwarn(_("compl(%f): fractional value will be truncated"), d);
- }
+ if (d < 0)
+ fatal(_("compl(%f): negative value is not allowed"), d);
+
+ if (do_lint && double_to_int(d) != d)
+ lintwarn(_("compl(%f): fractional value will be truncated"), d);
uval = (uintmax_t) d;
uval = ~ uval;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 305fc8e4..a3069283 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Document that negative arguments are not allowed
+ for bitwise functions. Add a sidebar explaining it a bit and
+ also showing the difference with and without -M.
+ * gawk.1: Document that negative arguments are not allowed.
+
2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Remove references to MS-DOS and OS/2,
diff --git a/doc/gawk.1 b/doc/gawk.1
index 751f8b89..22b41f34 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -3181,6 +3181,11 @@ values to
.B uintmax_t
integers, doing the operation, and then converting the
result back to floating point.
+.PP
+.BR NOTE :
+Passing negative operands to any of these functions causes
+a fatal error.
+.PP
The functions are:
.TP "\w'\fBrshift(\fIval\fB, \fIcount\fB)\fR'u+2n"
\fBand(\fIv1\fB, \fIv2 \fR[, ...]\fB)\fR
diff --git a/doc/gawk.info b/doc/gawk.info
index 1faa775c..b8ab365a 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -13471,13 +13471,10 @@ are enclosed in square brackets ([ ]):
Return the bitwise XOR of the arguments. There must be at least
two.
- For all of these functions, first the double-precision floating-point
-value is converted to the widest C unsigned integer type, then the
-bitwise operation is performed. If the result cannot be represented
-exactly as a C 'double', leading nonzero bits are removed one by one
-until it can be represented exactly. The result is then converted back
-into a C 'double'. (If you don't understand this paragraph, don't worry
-about it.)
+ CAUTION: Beginning with 'gawk' 4.1 4.2, negative operands are not
+ allowed for any of these functions. A negative operand produces a
+ fatal error. See the sidebar "Beware The Smoke and Mirrors!" for
+ more information as to why.
Here is a user-defined function (*note User-defined::) that
illustrates the use of these functions:
@@ -13539,12 +13536,61 @@ decimal and octal values for the same numbers (*note
Nondecimal-numbers::), and then demonstrates the results of the
'compl()', 'lshift()', and 'rshift()' functions.
+ Beware The Smoke and Mirrors!
+
+ It other languages, bitwise operations are performed on integer
+values, not floating-point values. As a general statement, such
+operations work best when performed on unsigned integers.
+
+ 'gawk' attempts to treat the arguments to the bitwise functions as
+unsigned integers. For this reason, negative arguments produce a fatal
+error.
+
+ In normal operation, for all of these functions, first the
+double-precision floating-point value is converted to the widest C
+unsigned integer type, then the bitwise operation is performed. If the
+result cannot be represented exactly as a C 'double', leading nonzero
+bits are removed one by one until it can be represented exactly. The
+result is then converted back into a C 'double'.(2)
+
+ However, when using arbitrary precision arithmetic with the '-M'
+option (*note Arbitrary Precision Arithmetic::), the results may differ.
+This is particularly noticable with the 'compl()' function:
+
+ $ gawk 'BEGIN { print compl(42) }'
+ -| 9007199254740949
+ $ gawk -M 'BEGIN { print compl(42) }'
+ -| -43
+
+ What's going on becomes clear when printing the results in
+hexadecimal:
+
+ $ gawk 'BEGIN { printf "%#x\n", compl(42) }'
+ -| 0x1fffffffffffd5
+ $ gawk -M 'BEGIN { printf "%#x\n", compl(42) }'
+ -| 0xffffffffffffffd5
+
+ When using the '-M' option, under the hood, 'gawk' uses GNU MP
+arbitrary precision integers which have at least 64 bits of precision.
+When not using '-M', 'gawk' stores integral values in regular
+double-precision floating point, which only maintain 53 bits of
+precision. Furthermore, the GNU MP library treats (or least seems to
+treat) the leading bit as a sign bit; thus the result with '-M' in this
+case is a negative number.
+
+ In short, using 'gawk' for any but the simplest kind of bitwise
+operations is probably a bad idea; caveat emptor!
+
---------- Footnotes ----------
(1) This example shows that zeros come in on the left side. For
'gawk', this is always true, but in some languages, it's possible to
have the left side fill with ones.
+ (2) If you don't understand this paragraph, the upshot is that 'gawk'
+can only store a particular range of integer values; numbers outside
+that range are reduced to fit within the range.
+

File: gawk.info, Node: Type Functions, Next: I18N Functions, Prev: Bitwise Functions, Up: Built-in
@@ -32646,7 +32692,7 @@ Index
* BINMODE variable: User-modified. (line 15)
* BINMODE variable <1>: PC Using. (line 16)
* bit-manipulation functions: Bitwise Functions. (line 6)
-* bits2str() user-defined function: Bitwise Functions. (line 72)
+* bits2str() user-defined function: Bitwise Functions. (line 69)
* bitwise AND: Bitwise Functions. (line 40)
* bitwise complement: Bitwise Functions. (line 44)
* bitwise OR: Bitwise Functions. (line 50)
@@ -32885,9 +32931,9 @@ Index
(line 31)
* converting, dates to timestamps: Time Functions. (line 76)
* converting, numbers to strings: Strings And Numbers. (line 6)
-* converting, numbers to strings <1>: Bitwise Functions. (line 111)
+* converting, numbers to strings <1>: Bitwise Functions. (line 108)
* converting, strings to numbers: Strings And Numbers. (line 6)
-* converting, strings to numbers <1>: Bitwise Functions. (line 111)
+* converting, strings to numbers <1>: Bitwise Functions. (line 108)
* CONVFMT variable: Strings And Numbers. (line 29)
* CONVFMT variable <1>: User-modified. (line 30)
* CONVFMT variable, and array subscripts: Numeric Array Subscripts.
@@ -34161,7 +34207,7 @@ Index
* null strings, converting numbers to strings: Strings And Numbers.
(line 21)
* null strings, matching: String Functions. (line 537)
-* number as string of bits: Bitwise Functions. (line 111)
+* number as string of bits: Bitwise Functions. (line 108)
* number of array elements: String Functions. (line 200)
* number sign (#), #! (executable scripts): Executable Scripts.
(line 6)
@@ -34172,7 +34218,7 @@ Index
* numbers, Cliff random: Cliff Random Function.
(line 6)
* numbers, converting: Strings And Numbers. (line 6)
-* numbers, converting <1>: Bitwise Functions. (line 111)
+* numbers, converting <1>: Bitwise Functions. (line 108)
* numbers, converting, to strings: User-modified. (line 30)
* numbers, converting, to strings <1>: User-modified. (line 104)
* numbers, hexadecimal: Nondecimal-numbers. (line 6)
@@ -34745,6 +34791,7 @@ Index
(line 63)
* sidebar, Backslash Before Regular Characters: Escape Sequences.
(line 106)
+* sidebar, Beware The Smoke and Mirrors!: Bitwise Functions. (line 126)
* sidebar, Changing FS Does Not Affect the Fields: Full Line Fields.
(line 14)
* sidebar, Changing NR and FNR: Auto-set. (line 355)
@@ -34875,7 +34922,7 @@ Index
* string-translation functions: I18N Functions. (line 6)
* strings splitting, example: String Functions. (line 334)
* strings, converting: Strings And Numbers. (line 6)
-* strings, converting <1>: Bitwise Functions. (line 111)
+* strings, converting <1>: Bitwise Functions. (line 108)
* strings, converting letter case: String Functions. (line 523)
* strings, converting, numbers to: User-modified. (line 30)
* strings, converting, numbers to <1>: User-modified. (line 104)
@@ -34926,7 +34973,7 @@ Index
* tee.awk program: Tee Program. (line 26)
* temporary breakpoint: Breakpoint Control. (line 90)
* terminating records: awk split records. (line 124)
-* testbits.awk program: Bitwise Functions. (line 72)
+* testbits.awk program: Bitwise Functions. (line 69)
* testext extension: Extension Sample API Tests.
(line 6)
* Texinfo: Conventions. (line 6)
@@ -35421,313 +35468,314 @@ Ref: Time Functions-Footnote-5569085
Ref: Time Functions-Footnote-6569312
Node: Bitwise Functions569578
Ref: table-bitwise-ops570172
-Ref: Bitwise Functions-Footnote-1574510
-Node: Type Functions574683
-Node: I18N Functions577215
-Node: User-defined578866
-Node: Definition Syntax579671
-Ref: Definition Syntax-Footnote-1585358
-Node: Function Example585429
-Ref: Function Example-Footnote-1588351
-Node: Function Caveats588373
-Node: Calling A Function588891
-Node: Variable Scope589849
-Node: Pass By Value/Reference592843
-Node: Return Statement596342
-Node: Dynamic Typing599321
-Node: Indirect Calls600251
-Ref: Indirect Calls-Footnote-1610502
-Node: Functions Summary610630
-Node: Library Functions613335
-Ref: Library Functions-Footnote-1616942
-Ref: Library Functions-Footnote-2617085
-Node: Library Names617256
-Ref: Library Names-Footnote-1620716
-Ref: Library Names-Footnote-2620939
-Node: General Functions621025
-Node: Strtonum Function622128
-Node: Assert Function625150
-Node: Round Function628476
-Node: Cliff Random Function630017
-Node: Ordinal Functions631033
-Ref: Ordinal Functions-Footnote-1634096
-Ref: Ordinal Functions-Footnote-2634348
-Node: Join Function634558
-Ref: Join Function-Footnote-1636328
-Node: Getlocaltime Function636528
-Node: Readfile Function640270
-Node: Shell Quoting642242
-Node: Data File Management643643
-Node: Filetrans Function644275
-Node: Rewind Function648371
-Node: File Checking650277
-Ref: File Checking-Footnote-1651611
-Node: Empty Files651812
-Node: Ignoring Assigns653791
-Node: Getopt Function655341
-Ref: Getopt Function-Footnote-1666810
-Node: Passwd Functions667010
-Ref: Passwd Functions-Footnote-1675849
-Node: Group Functions675937
-Ref: Group Functions-Footnote-1683835
-Node: Walking Arrays684042
-Node: Library Functions Summary687050
-Node: Library Exercises688456
-Node: Sample Programs688921
-Node: Running Examples689691
-Node: Clones690419
-Node: Cut Program691643
-Node: Egrep Program701572
-Ref: Egrep Program-Footnote-1709084
-Node: Id Program709194
-Node: Split Program712874
-Ref: Split Program-Footnote-1716333
-Node: Tee Program716462
-Node: Uniq Program719252
-Node: Wc Program726678
-Ref: Wc Program-Footnote-1730933
-Node: Miscellaneous Programs731027
-Node: Dupword Program732240
-Node: Alarm Program734270
-Node: Translate Program739125
-Ref: Translate Program-Footnote-1743690
-Node: Labels Program743960
-Ref: Labels Program-Footnote-1747311
-Node: Word Sorting747395
-Node: History Sorting751467
-Node: Extract Program753302
-Node: Simple Sed760831
-Node: Igawk Program763905
-Ref: Igawk Program-Footnote-1778236
-Ref: Igawk Program-Footnote-2778438
-Ref: Igawk Program-Footnote-3778560
-Node: Anagram Program778675
-Node: Signature Program781737
-Node: Programs Summary782984
-Node: Programs Exercises784198
-Ref: Programs Exercises-Footnote-1788327
-Node: Advanced Features788418
-Node: Nondecimal Data790408
-Node: Array Sorting791999
-Node: Controlling Array Traversal792699
-Ref: Controlling Array Traversal-Footnote-1801066
-Node: Array Sorting Functions801184
-Ref: Array Sorting Functions-Footnote-1806275
-Node: Two-way I/O806471
-Ref: Two-way I/O-Footnote-1813021
-Ref: Two-way I/O-Footnote-2813208
-Node: TCP/IP Networking813290
-Node: Profiling816408
-Ref: Profiling-Footnote-1824901
-Node: Advanced Features Summary825224
-Node: Internationalization827068
-Node: I18N and L10N828548
-Node: Explaining gettext829235
-Ref: Explaining gettext-Footnote-1835127
-Ref: Explaining gettext-Footnote-2835312
-Node: Programmer i18n835477
-Ref: Programmer i18n-Footnote-1840332
-Node: Translator i18n840381
-Node: String Extraction841175
-Ref: String Extraction-Footnote-1842307
-Node: Printf Ordering842393
-Ref: Printf Ordering-Footnote-1845179
-Node: I18N Portability845243
-Ref: I18N Portability-Footnote-1847699
-Node: I18N Example847762
-Ref: I18N Example-Footnote-1850568
-Node: Gawk I18N850641
-Node: I18N Summary851286
-Node: Debugger852627
-Node: Debugging853649
-Node: Debugging Concepts854090
-Node: Debugging Terms855899
-Node: Awk Debugging858474
-Node: Sample Debugging Session859380
-Node: Debugger Invocation859914
-Node: Finding The Bug861300
-Node: List of Debugger Commands867778
-Node: Breakpoint Control869111
-Node: Debugger Execution Control872805
-Node: Viewing And Changing Data876167
-Node: Execution Stack879541
-Node: Debugger Info881178
-Node: Miscellaneous Debugger Commands885249
-Node: Readline Support890337
-Node: Limitations891233
-Ref: Limitations-Footnote-1895464
-Node: Debugging Summary895515
-Node: Arbitrary Precision Arithmetic896794
-Node: Computer Arithmetic898210
-Ref: table-numeric-ranges901801
-Ref: Computer Arithmetic-Footnote-1902523
-Node: Math Definitions902580
-Ref: table-ieee-formats905894
-Ref: Math Definitions-Footnote-1906497
-Node: MPFR features906602
-Node: FP Math Caution908319
-Ref: FP Math Caution-Footnote-1909391
-Node: Inexactness of computations909760
-Node: Inexact representation910720
-Node: Comparing FP Values912080
-Node: Errors accumulate913162
-Node: Getting Accuracy914595
-Node: Try To Round917305
-Node: Setting precision918204
-Ref: table-predefined-precision-strings918901
-Node: Setting the rounding mode920731
-Ref: table-gawk-rounding-modes921105
-Ref: Setting the rounding mode-Footnote-1924513
-Node: Arbitrary Precision Integers924692
-Ref: Arbitrary Precision Integers-Footnote-1929609
-Node: POSIX Floating Point Problems929758
-Ref: POSIX Floating Point Problems-Footnote-1933640
-Node: Floating point summary933678
-Node: Dynamic Extensions935868
-Node: Extension Intro937421
-Node: Plugin License938687
-Node: Extension Mechanism Outline939484
-Ref: figure-load-extension939923
-Ref: figure-register-new-function941488
-Ref: figure-call-new-function942580
-Node: Extension API Description944642
-Node: Extension API Functions Introduction946174
-Node: General Data Types951033
-Ref: General Data Types-Footnote-1956988
-Node: Memory Allocation Functions957287
-Ref: Memory Allocation Functions-Footnote-1960132
-Node: Constructor Functions960231
-Node: Registration Functions961976
-Node: Extension Functions962661
-Node: Exit Callback Functions965284
-Node: Extension Version String966534
-Node: Input Parsers967197
-Node: Output Wrappers977079
-Node: Two-way processors981591
-Node: Printing Messages983856
-Ref: Printing Messages-Footnote-1985027
-Node: Updating ERRNO985180
-Node: Requesting Values985919
-Ref: table-value-types-returned986656
-Node: Accessing Parameters987539
-Node: Symbol Table Access988774
-Node: Symbol table by name989286
-Node: Symbol table by cookie991307
-Ref: Symbol table by cookie-Footnote-1995459
-Node: Cached values995523
-Ref: Cached values-Footnote-1999030
-Node: Array Manipulation999121
-Ref: Array Manipulation-Footnote-11000212
-Node: Array Data Types1000249
-Ref: Array Data Types-Footnote-11002907
-Node: Array Functions1002999
-Node: Flattening Arrays1006857
-Node: Creating Arrays1013765
-Node: Redirection API1018534
-Node: Extension API Variables1021365
-Node: Extension Versioning1021998
-Ref: gawk-api-version1022435
-Node: Extension API Informational Variables1024191
-Node: Extension API Boilerplate1025255
-Node: Finding Extensions1029069
-Node: Extension Example1029628
-Node: Internal File Description1030426
-Node: Internal File Ops1034506
-Ref: Internal File Ops-Footnote-11046268
-Node: Using Internal File Ops1046408
-Ref: Using Internal File Ops-Footnote-11048791
-Node: Extension Samples1049065
-Node: Extension Sample File Functions1050594
-Node: Extension Sample Fnmatch1058243
-Node: Extension Sample Fork1059730
-Node: Extension Sample Inplace1060948
-Node: Extension Sample Ord1064158
-Node: Extension Sample Readdir1064994
-Ref: table-readdir-file-types1065883
-Node: Extension Sample Revout1066688
-Node: Extension Sample Rev2way1067277
-Node: Extension Sample Read write array1068017
-Node: Extension Sample Readfile1069959
-Node: Extension Sample Time1071054
-Node: Extension Sample API Tests1072402
-Node: gawkextlib1072894
-Node: Extension summary1075341
-Node: Extension Exercises1079043
-Node: Language History1080541
-Node: V7/SVR3.11082197
-Node: SVR41084349
-Node: POSIX1085783
-Node: BTL1087162
-Node: POSIX/GNU1087891
-Node: Feature History1093753
-Node: Common Extensions1108123
-Node: Ranges and Locales1109406
-Ref: Ranges and Locales-Footnote-11114022
-Ref: Ranges and Locales-Footnote-21114049
-Ref: Ranges and Locales-Footnote-31114284
-Node: Contributors1114505
-Node: History summary1120065
-Node: Installation1121445
-Node: Gawk Distribution1122389
-Node: Getting1122873
-Node: Extracting1123834
-Node: Distribution contents1125472
-Node: Unix Installation1131557
-Node: Quick Installation1132239
-Node: Shell Startup Files1134653
-Node: Additional Configuration Options1135731
-Node: Configuration Philosophy1137536
-Node: Non-Unix Installation1139905
-Node: PC Installation1140365
-Node: PC Binary Installation1141203
-Node: PC Compiling1141638
-Node: PC Using1142755
-Node: Cygwin1145800
-Node: MSYS1146570
-Node: VMS Installation1147071
-Node: VMS Compilation1147862
-Ref: VMS Compilation-Footnote-11149091
-Node: VMS Dynamic Extensions1149149
-Node: VMS Installation Details1150834
-Node: VMS Running1153087
-Node: VMS GNV1157366
-Node: VMS Old Gawk1158101
-Node: Bugs1158572
-Node: Bug address1159235
-Node: Usenet1161632
-Node: Maintainers1162407
-Node: Other Versions1163783
-Node: Installation summary1170367
-Node: Notes1171402
-Node: Compatibility Mode1172267
-Node: Additions1173049
-Node: Accessing The Source1173974
-Node: Adding Code1175409
-Node: New Ports1181628
-Node: Derived Files1186116
-Ref: Derived Files-Footnote-11191601
-Ref: Derived Files-Footnote-21191636
-Ref: Derived Files-Footnote-31192234
-Node: Future Extensions1192348
-Node: Implementation Limitations1193006
-Node: Extension Design1194189
-Node: Old Extension Problems1195343
-Ref: Old Extension Problems-Footnote-11196861
-Node: Extension New Mechanism Goals1196918
-Ref: Extension New Mechanism Goals-Footnote-11200282
-Node: Extension Other Design Decisions1200471
-Node: Extension Future Growth1202584
-Node: Old Extension Mechanism1203420
-Node: Notes summary1205183
-Node: Basic Concepts1206365
-Node: Basic High Level1207046
-Ref: figure-general-flow1207328
-Ref: figure-process-flow1208013
-Ref: Basic High Level-Footnote-11211314
-Node: Basic Data Typing1211499
-Node: Glossary1214827
-Node: Copying1246774
-Node: GNU Free Documentation License1284313
-Node: Index1309431
+Ref: Bitwise Functions-Footnote-1576217
+Ref: Bitwise Functions-Footnote-2576390
+Node: Type Functions576581
+Node: I18N Functions579113
+Node: User-defined580764
+Node: Definition Syntax581569
+Ref: Definition Syntax-Footnote-1587256
+Node: Function Example587327
+Ref: Function Example-Footnote-1590249
+Node: Function Caveats590271
+Node: Calling A Function590789
+Node: Variable Scope591747
+Node: Pass By Value/Reference594741
+Node: Return Statement598240
+Node: Dynamic Typing601219
+Node: Indirect Calls602149
+Ref: Indirect Calls-Footnote-1612400
+Node: Functions Summary612528
+Node: Library Functions615233
+Ref: Library Functions-Footnote-1618840
+Ref: Library Functions-Footnote-2618983
+Node: Library Names619154
+Ref: Library Names-Footnote-1622614
+Ref: Library Names-Footnote-2622837
+Node: General Functions622923
+Node: Strtonum Function624026
+Node: Assert Function627048
+Node: Round Function630374
+Node: Cliff Random Function631915
+Node: Ordinal Functions632931
+Ref: Ordinal Functions-Footnote-1635994
+Ref: Ordinal Functions-Footnote-2636246
+Node: Join Function636456
+Ref: Join Function-Footnote-1638226
+Node: Getlocaltime Function638426
+Node: Readfile Function642168
+Node: Shell Quoting644140
+Node: Data File Management645541
+Node: Filetrans Function646173
+Node: Rewind Function650269
+Node: File Checking652175
+Ref: File Checking-Footnote-1653509
+Node: Empty Files653710
+Node: Ignoring Assigns655689
+Node: Getopt Function657239
+Ref: Getopt Function-Footnote-1668708
+Node: Passwd Functions668908
+Ref: Passwd Functions-Footnote-1677747
+Node: Group Functions677835
+Ref: Group Functions-Footnote-1685733
+Node: Walking Arrays685940
+Node: Library Functions Summary688948
+Node: Library Exercises690354
+Node: Sample Programs690819
+Node: Running Examples691589
+Node: Clones692317
+Node: Cut Program693541
+Node: Egrep Program703470
+Ref: Egrep Program-Footnote-1710982
+Node: Id Program711092
+Node: Split Program714772
+Ref: Split Program-Footnote-1718231
+Node: Tee Program718360
+Node: Uniq Program721150
+Node: Wc Program728576
+Ref: Wc Program-Footnote-1732831
+Node: Miscellaneous Programs732925
+Node: Dupword Program734138
+Node: Alarm Program736168
+Node: Translate Program741023
+Ref: Translate Program-Footnote-1745588
+Node: Labels Program745858
+Ref: Labels Program-Footnote-1749209
+Node: Word Sorting749293
+Node: History Sorting753365
+Node: Extract Program755200
+Node: Simple Sed762729
+Node: Igawk Program765803
+Ref: Igawk Program-Footnote-1780134
+Ref: Igawk Program-Footnote-2780336
+Ref: Igawk Program-Footnote-3780458
+Node: Anagram Program780573
+Node: Signature Program783635
+Node: Programs Summary784882
+Node: Programs Exercises786096
+Ref: Programs Exercises-Footnote-1790225
+Node: Advanced Features790316
+Node: Nondecimal Data792306
+Node: Array Sorting793897
+Node: Controlling Array Traversal794597
+Ref: Controlling Array Traversal-Footnote-1802964
+Node: Array Sorting Functions803082
+Ref: Array Sorting Functions-Footnote-1808173
+Node: Two-way I/O808369
+Ref: Two-way I/O-Footnote-1814919
+Ref: Two-way I/O-Footnote-2815106
+Node: TCP/IP Networking815188
+Node: Profiling818306
+Ref: Profiling-Footnote-1826799
+Node: Advanced Features Summary827122
+Node: Internationalization828966
+Node: I18N and L10N830446
+Node: Explaining gettext831133
+Ref: Explaining gettext-Footnote-1837025
+Ref: Explaining gettext-Footnote-2837210
+Node: Programmer i18n837375
+Ref: Programmer i18n-Footnote-1842230
+Node: Translator i18n842279
+Node: String Extraction843073
+Ref: String Extraction-Footnote-1844205
+Node: Printf Ordering844291
+Ref: Printf Ordering-Footnote-1847077
+Node: I18N Portability847141
+Ref: I18N Portability-Footnote-1849597
+Node: I18N Example849660
+Ref: I18N Example-Footnote-1852466
+Node: Gawk I18N852539
+Node: I18N Summary853184
+Node: Debugger854525
+Node: Debugging855547
+Node: Debugging Concepts855988
+Node: Debugging Terms857797
+Node: Awk Debugging860372
+Node: Sample Debugging Session861278
+Node: Debugger Invocation861812
+Node: Finding The Bug863198
+Node: List of Debugger Commands869676
+Node: Breakpoint Control871009
+Node: Debugger Execution Control874703
+Node: Viewing And Changing Data878065
+Node: Execution Stack881439
+Node: Debugger Info883076
+Node: Miscellaneous Debugger Commands887147
+Node: Readline Support892235
+Node: Limitations893131
+Ref: Limitations-Footnote-1897362
+Node: Debugging Summary897413
+Node: Arbitrary Precision Arithmetic898692
+Node: Computer Arithmetic900108
+Ref: table-numeric-ranges903699
+Ref: Computer Arithmetic-Footnote-1904421
+Node: Math Definitions904478
+Ref: table-ieee-formats907792
+Ref: Math Definitions-Footnote-1908395
+Node: MPFR features908500
+Node: FP Math Caution910217
+Ref: FP Math Caution-Footnote-1911289
+Node: Inexactness of computations911658
+Node: Inexact representation912618
+Node: Comparing FP Values913978
+Node: Errors accumulate915060
+Node: Getting Accuracy916493
+Node: Try To Round919203
+Node: Setting precision920102
+Ref: table-predefined-precision-strings920799
+Node: Setting the rounding mode922629
+Ref: table-gawk-rounding-modes923003
+Ref: Setting the rounding mode-Footnote-1926411
+Node: Arbitrary Precision Integers926590
+Ref: Arbitrary Precision Integers-Footnote-1931507
+Node: POSIX Floating Point Problems931656
+Ref: POSIX Floating Point Problems-Footnote-1935538
+Node: Floating point summary935576
+Node: Dynamic Extensions937766
+Node: Extension Intro939319
+Node: Plugin License940585
+Node: Extension Mechanism Outline941382
+Ref: figure-load-extension941821
+Ref: figure-register-new-function943386
+Ref: figure-call-new-function944478
+Node: Extension API Description946540
+Node: Extension API Functions Introduction948072
+Node: General Data Types952931
+Ref: General Data Types-Footnote-1958886
+Node: Memory Allocation Functions959185
+Ref: Memory Allocation Functions-Footnote-1962030
+Node: Constructor Functions962129
+Node: Registration Functions963874
+Node: Extension Functions964559
+Node: Exit Callback Functions967182
+Node: Extension Version String968432
+Node: Input Parsers969095
+Node: Output Wrappers978977
+Node: Two-way processors983489
+Node: Printing Messages985754
+Ref: Printing Messages-Footnote-1986925
+Node: Updating ERRNO987078
+Node: Requesting Values987817
+Ref: table-value-types-returned988554
+Node: Accessing Parameters989437
+Node: Symbol Table Access990672
+Node: Symbol table by name991184
+Node: Symbol table by cookie993205
+Ref: Symbol table by cookie-Footnote-1997357
+Node: Cached values997421
+Ref: Cached values-Footnote-11000928
+Node: Array Manipulation1001019
+Ref: Array Manipulation-Footnote-11002110
+Node: Array Data Types1002147
+Ref: Array Data Types-Footnote-11004805
+Node: Array Functions1004897
+Node: Flattening Arrays1008755
+Node: Creating Arrays1015663
+Node: Redirection API1020432
+Node: Extension API Variables1023263
+Node: Extension Versioning1023896
+Ref: gawk-api-version1024333
+Node: Extension API Informational Variables1026089
+Node: Extension API Boilerplate1027153
+Node: Finding Extensions1030967
+Node: Extension Example1031526
+Node: Internal File Description1032324
+Node: Internal File Ops1036404
+Ref: Internal File Ops-Footnote-11048166
+Node: Using Internal File Ops1048306
+Ref: Using Internal File Ops-Footnote-11050689
+Node: Extension Samples1050963
+Node: Extension Sample File Functions1052492
+Node: Extension Sample Fnmatch1060141
+Node: Extension Sample Fork1061628
+Node: Extension Sample Inplace1062846
+Node: Extension Sample Ord1066056
+Node: Extension Sample Readdir1066892
+Ref: table-readdir-file-types1067781
+Node: Extension Sample Revout1068586
+Node: Extension Sample Rev2way1069175
+Node: Extension Sample Read write array1069915
+Node: Extension Sample Readfile1071857
+Node: Extension Sample Time1072952
+Node: Extension Sample API Tests1074300
+Node: gawkextlib1074792
+Node: Extension summary1077239
+Node: Extension Exercises1080941
+Node: Language History1082439
+Node: V7/SVR3.11084095
+Node: SVR41086247
+Node: POSIX1087681
+Node: BTL1089060
+Node: POSIX/GNU1089789
+Node: Feature History1095651
+Node: Common Extensions1110021
+Node: Ranges and Locales1111304
+Ref: Ranges and Locales-Footnote-11115920
+Ref: Ranges and Locales-Footnote-21115947
+Ref: Ranges and Locales-Footnote-31116182
+Node: Contributors1116403
+Node: History summary1121963
+Node: Installation1123343
+Node: Gawk Distribution1124287
+Node: Getting1124771
+Node: Extracting1125732
+Node: Distribution contents1127370
+Node: Unix Installation1133455
+Node: Quick Installation1134137
+Node: Shell Startup Files1136551
+Node: Additional Configuration Options1137629
+Node: Configuration Philosophy1139434
+Node: Non-Unix Installation1141803
+Node: PC Installation1142263
+Node: PC Binary Installation1143101
+Node: PC Compiling1143536
+Node: PC Using1144653
+Node: Cygwin1147698
+Node: MSYS1148468
+Node: VMS Installation1148969
+Node: VMS Compilation1149760
+Ref: VMS Compilation-Footnote-11150989
+Node: VMS Dynamic Extensions1151047
+Node: VMS Installation Details1152732
+Node: VMS Running1154985
+Node: VMS GNV1159264
+Node: VMS Old Gawk1159999
+Node: Bugs1160470
+Node: Bug address1161133
+Node: Usenet1163530
+Node: Maintainers1164305
+Node: Other Versions1165681
+Node: Installation summary1172265
+Node: Notes1173300
+Node: Compatibility Mode1174165
+Node: Additions1174947
+Node: Accessing The Source1175872
+Node: Adding Code1177307
+Node: New Ports1183526
+Node: Derived Files1188014
+Ref: Derived Files-Footnote-11193499
+Ref: Derived Files-Footnote-21193534
+Ref: Derived Files-Footnote-31194132
+Node: Future Extensions1194246
+Node: Implementation Limitations1194904
+Node: Extension Design1196087
+Node: Old Extension Problems1197241
+Ref: Old Extension Problems-Footnote-11198759
+Node: Extension New Mechanism Goals1198816
+Ref: Extension New Mechanism Goals-Footnote-11202180
+Node: Extension Other Design Decisions1202369
+Node: Extension Future Growth1204482
+Node: Old Extension Mechanism1205318
+Node: Notes summary1207081
+Node: Basic Concepts1208263
+Node: Basic High Level1208944
+Ref: figure-general-flow1209226
+Ref: figure-process-flow1209911
+Ref: Basic High Level-Footnote-11213212
+Node: Basic Data Typing1213397
+Node: Glossary1216725
+Node: Copying1248672
+Node: GNU Free Documentation License1286211
+Node: Index1311329

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index adc5c917..3c31cef5 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -19379,12 +19379,12 @@ Return the value of @var{val}, shifted right by @var{count} bits.
Return the bitwise XOR of the arguments. There must be at least two.
@end table
-For all of these functions, first the double-precision floating-point value is
-converted to the widest C unsigned integer type, then the bitwise operation is
-performed. If the result cannot be represented exactly as a C @code{double},
-leading nonzero bits are removed one by one until it can be represented
-exactly. The result is then converted back into a C @code{double}. (If
-you don't understand this paragraph, don't worry about it.)
+@quotation CAUTION
+Beginning with @command{gawk} @value{VERSION} 4.2, negative
+operands are not allowed for any of these functions. A negative
+operand produces a fatal error. See the sidebar
+``Beware The Smoke and Mirrors!'' for more information as to why.
+@end quotation
Here is a user-defined function (@pxref{User-defined})
that illustrates the use of these functions:
@@ -19489,6 +19489,128 @@ decimal and octal values for the same numbers
and then demonstrates the
results of the @code{compl()}, @code{lshift()}, and @code{rshift()} functions.
+@cindex sidebar, Beware The Smoke and Mirrors!
+@ifdocbook
+@docbook
+<sidebar><title>Beware The Smoke and Mirrors!</title>
+@end docbook
+
+
+It other languages, bitwise operations are performed on integer values,
+not floating-point values. As a general statement, such operations work
+best when performed on unsigned integers.
+
+@command{gawk} attempts to treat the arguments to the bitwise functions
+as unsigned integers. For this reason, negative arguments produce a
+fatal error.
+
+In normal operation, for all of these functions, first the
+double-precision floating-point value is converted to the widest C
+unsigned integer type, then the bitwise operation is performed. If the
+result cannot be represented exactly as a C @code{double}, leading
+nonzero bits are removed one by one until it can be represented exactly.
+The result is then converted back into a C @code{double}.@footnote{If you don't
+understand this paragraph, the upshot is that @command{gawk} can only
+store a particular range of integer values; numbers outside that range
+are reduced to fit within the range.}
+
+However, when using arbitrary precision arithmetic with the @option{-M}
+option (@pxref{Arbitrary Precision Arithmetic}), the results may differ.
+This is particularly noticable with the @code{compl()} function:
+
+@example
+$ @kbd{gawk 'BEGIN @{ print compl(42) @}'}
+@print{} 9007199254740949
+$ @kbd{gawk -M 'BEGIN @{ print compl(42) @}'}
+@print{} -43
+@end example
+
+What's going on becomes clear when printing the results
+in hexadecimal:
+
+@example
+$ @kbd{gawk 'BEGIN @{ printf "%#x\n", compl(42) @}'}
+@print{} 0x1fffffffffffd5
+$ @kbd{gawk -M 'BEGIN @{ printf "%#x\n", compl(42) @}'}
+@print{} 0xffffffffffffffd5
+@end example
+
+When using the @option{-M} option, under the hood, @command{gawk} uses
+GNU MP arbitrary precision integers which have at least 64 bits of precision.
+When not using @option{-M}, @command{gawk} stores integral values in
+regular double-precision floating point, which only maintain 53 bits of
+precision. Furthermore, the GNU MP library treats (or least seems to treat)
+the leading bit as a sign bit; thus the result with @option{-M} in this case is
+a negative number.
+
+In short, using @command{gawk} for any but the simplest kind of bitwise
+operations is probably a bad idea; caveat emptor!
+
+
+@docbook
+</sidebar>
+@end docbook
+@end ifdocbook
+
+@ifnotdocbook
+@cartouche
+@center @b{Beware The Smoke and Mirrors!}
+
+
+
+It other languages, bitwise operations are performed on integer values,
+not floating-point values. As a general statement, such operations work
+best when performed on unsigned integers.
+
+@command{gawk} attempts to treat the arguments to the bitwise functions
+as unsigned integers. For this reason, negative arguments produce a
+fatal error.
+
+In normal operation, for all of these functions, first the
+double-precision floating-point value is converted to the widest C
+unsigned integer type, then the bitwise operation is performed. If the
+result cannot be represented exactly as a C @code{double}, leading
+nonzero bits are removed one by one until it can be represented exactly.
+The result is then converted back into a C @code{double}.@footnote{If you don't
+understand this paragraph, the upshot is that @command{gawk} can only
+store a particular range of integer values; numbers outside that range
+are reduced to fit within the range.}
+
+However, when using arbitrary precision arithmetic with the @option{-M}
+option (@pxref{Arbitrary Precision Arithmetic}), the results may differ.
+This is particularly noticable with the @code{compl()} function:
+
+@example
+$ @kbd{gawk 'BEGIN @{ print compl(42) @}'}
+@print{} 9007199254740949
+$ @kbd{gawk -M 'BEGIN @{ print compl(42) @}'}
+@print{} -43
+@end example
+
+What's going on becomes clear when printing the results
+in hexadecimal:
+
+@example
+$ @kbd{gawk 'BEGIN @{ printf "%#x\n", compl(42) @}'}
+@print{} 0x1fffffffffffd5
+$ @kbd{gawk -M 'BEGIN @{ printf "%#x\n", compl(42) @}'}
+@print{} 0xffffffffffffffd5
+@end example
+
+When using the @option{-M} option, under the hood, @command{gawk} uses
+GNU MP arbitrary precision integers which have at least 64 bits of precision.
+When not using @option{-M}, @command{gawk} stores integral values in
+regular double-precision floating point, which only maintain 53 bits of
+precision. Furthermore, the GNU MP library treats (or least seems to treat)
+the leading bit as a sign bit; thus the result with @option{-M} in this case is
+a negative number.
+
+In short, using @command{gawk} for any but the simplest kind of bitwise
+operations is probably a bad idea; caveat emptor!
+
+@end cartouche
+@end ifnotdocbook
+
@node Type Functions
@subsection Getting Type Information
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index afcf749a..14a1748c 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -18491,12 +18491,12 @@ Return the value of @var{val}, shifted right by @var{count} bits.
Return the bitwise XOR of the arguments. There must be at least two.
@end table
-For all of these functions, first the double-precision floating-point value is
-converted to the widest C unsigned integer type, then the bitwise operation is
-performed. If the result cannot be represented exactly as a C @code{double},
-leading nonzero bits are removed one by one until it can be represented
-exactly. The result is then converted back into a C @code{double}. (If
-you don't understand this paragraph, don't worry about it.)
+@quotation CAUTION
+Beginning with @command{gawk} @value{VERSION} 4.2, negative
+operands are not allowed for any of these functions. A negative
+operand produces a fatal error. See the sidebar
+``Beware The Smoke and Mirrors!'' for more information as to why.
+@end quotation
Here is a user-defined function (@pxref{User-defined})
that illustrates the use of these functions:
@@ -18601,6 +18601,60 @@ decimal and octal values for the same numbers
and then demonstrates the
results of the @code{compl()}, @code{lshift()}, and @code{rshift()} functions.
+@sidebar Beware The Smoke and Mirrors!
+
+It other languages, bitwise operations are performed on integer values,
+not floating-point values. As a general statement, such operations work
+best when performed on unsigned integers.
+
+@command{gawk} attempts to treat the arguments to the bitwise functions
+as unsigned integers. For this reason, negative arguments produce a
+fatal error.
+
+In normal operation, for all of these functions, first the
+double-precision floating-point value is converted to the widest C
+unsigned integer type, then the bitwise operation is performed. If the
+result cannot be represented exactly as a C @code{double}, leading
+nonzero bits are removed one by one until it can be represented exactly.
+The result is then converted back into a C @code{double}.@footnote{If you don't
+understand this paragraph, the upshot is that @command{gawk} can only
+store a particular range of integer values; numbers outside that range
+are reduced to fit within the range.}
+
+However, when using arbitrary precision arithmetic with the @option{-M}
+option (@pxref{Arbitrary Precision Arithmetic}), the results may differ.
+This is particularly noticable with the @code{compl()} function:
+
+@example
+$ @kbd{gawk 'BEGIN @{ print compl(42) @}'}
+@print{} 9007199254740949
+$ @kbd{gawk -M 'BEGIN @{ print compl(42) @}'}
+@print{} -43
+@end example
+
+What's going on becomes clear when printing the results
+in hexadecimal:
+
+@example
+$ @kbd{gawk 'BEGIN @{ printf "%#x\n", compl(42) @}'}
+@print{} 0x1fffffffffffd5
+$ @kbd{gawk -M 'BEGIN @{ printf "%#x\n", compl(42) @}'}
+@print{} 0xffffffffffffffd5
+@end example
+
+When using the @option{-M} option, under the hood, @command{gawk} uses
+GNU MP arbitrary precision integers which have at least 64 bits of precision.
+When not using @option{-M}, @command{gawk} stores integral values in
+regular double-precision floating point, which only maintain 53 bits of
+precision. Furthermore, the GNU MP library treats (or least seems to treat)
+the leading bit as a sign bit; thus the result with @option{-M} in this case is
+a negative number.
+
+In short, using @command{gawk} for any but the simplest kind of bitwise
+operations is probably a bad idea; caveat emptor!
+
+@end sidebar
+
@node Type Functions
@subsection Getting Type Information
diff --git a/mpfr.c b/mpfr.c
index c3795d21..cdcc9bb2 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -813,11 +813,11 @@ do_mpfr_compl(int nargs)
/* [+-]inf or NaN */
return tmp;
}
- if (do_lint) {
- if (mpfr_sgn(p) < 0)
- lintwarn("%s",
- mpg_fmt(_("compl(%Rg): negative value will give strange results"), p)
+ if (mpfr_sgn(p) < 0)
+ fatal("%s",
+ mpg_fmt(_("compl(%Rg): negative value is not allowed"), p)
);
+ if (do_lint) {
if (! mpfr_integer_p(p))
lintwarn("%s",
mpg_fmt(_("comp(%Rg): fractional value will be truncated"), p)
@@ -829,12 +829,10 @@ do_mpfr_compl(int nargs)
} else {
/* (tmp->flags & MPZN) != 0 */
zptr = tmp->mpg_i;
- if (do_lint) {
- if (mpz_sgn(zptr) < 0)
- lintwarn("%s",
- mpg_fmt(_("cmpl(%Zd): negative values will give strange results"), zptr)
+ if (mpz_sgn(zptr) < 0)
+ fatal("%s",
+ mpg_fmt(_("compl(%Zd): negative values is not allowed"), zptr)
);
- }
}
r = mpg_integer();
@@ -870,13 +868,13 @@ get_intval(NODE *t1, int argnum, const char *op)
return pz; /* should be freed */
}
- if (do_lint) {
- if (mpfr_sgn(left) < 0)
- lintwarn("%s",
- mpg_fmt(_("%s: argument #%d negative value %Rg will give strange results"),
+ if (mpfr_sgn(left) < 0)
+ fatal("%s",
+ mpg_fmt(_("%s: argument #%d negative value %Rg is not allowed"),
op, argnum, left)
);
+ if (do_lint) {
if (! mpfr_integer_p(left))
lintwarn("%s",
mpg_fmt(_("%s: argument #%d fractional value %Rg will be truncated"),
@@ -891,13 +889,12 @@ get_intval(NODE *t1, int argnum, const char *op)
}
/* (t1->flags & MPZN) != 0 */
pz = t1->mpg_i;
- if (do_lint) {
- if (mpz_sgn(pz) < 0)
- lintwarn("%s",
- mpg_fmt(_("%s: argument #%d negative value %Zd will give strange results"),
+ if (mpz_sgn(pz) < 0)
+ fatal("%s",
+ mpg_fmt(_("%s: argument #%d negative value %Zd is not allowed"),
op, argnum, pz)
);
- }
+
return pz; /* must not be freed */
}