gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, master, updated. gawk-4.1.0-5701-gdd309e26


From: Arnold Robbins
Subject: [SCM] gawk branch, master, updated. gawk-4.1.0-5701-gdd309e26
Date: Thu, 24 Oct 2024 14:44:30 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, master has been updated
       via  dd309e2626b132dcd9e2693a64eaf17f69e25719 (commit)
      from  13a61e3a71bf8953798b86384af772bb548e1998 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=dd309e2626b132dcd9e2693a64eaf17f69e25719

commit dd309e2626b132dcd9e2693a64eaf17f69e25719
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Oct 24 21:43:54 2024 +0300

    Change lshift/rshift to return 0 if shifting by too many bits.

diff --git a/ChangeLog b/ChangeLog
index 927e5057..1d379e32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
-2024-10-17  Paul Eggert  <eggert@cs.ucla.edu>
+2024-10-24         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * builtin.c (do_lshift, do_rshift): If shifting by too many
+       bits, return zero. Adjust lint messages. Thanks to
+       prospero <prospero@cyber-wizard.com> for the report.
+       * NEWS: Updated.
+
+2024-10-17         Paul Eggert           <eggert@cs.ucla.edu>
 
        * floatcomp.c (adjust_uint): Add commentary.
 
diff --git a/NEWS b/NEWS
index 06207875..266bf9e0 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ Changes from 5.3.x to 5.4.0
    but does not reset the namespace for the included file to "awk". See
    the manual for details.
 
+2. When using lshift() or rshift() and attempting to shift by as many
+   or more bits than in a uintmax_t, gawk returns zero, instead of
+   whatever the C compiler and hardware might have done.
+
 Changes from 5.3.1 to 5.3.x
 ---------------------------
 
diff --git a/builtin.c b/builtin.c
index 3c4c8f91..c887b3ce 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2424,20 +2424,25 @@ do_lshift(int nargs)
        if (val < 0 || shift < 0)
                fatal(_("lshift(%f, %f): negative values are not allowed"), 
val, shift);
 
-       if (do_lint) {
-               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)
-                       lintwarn(_("lshift(%f, %f): too large shift value will 
give strange results"), val, shift);
+       if (do_lint && (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) {
+               // within range
+               uval = (uintmax_t) val;
+               ushift = (uintmax_t) shift;
+
+               res = uval << ushift;
+       } else {
+               // out of range
+               if (do_lint)
+                       lintwarn(_("lshift(%f, %f): too large shift value 
returns zero"), val, shift);
+               res = 0;
        }
 
        DEREF(s1);
        DEREF(s2);
 
-       uval = (uintmax_t) val;
-       ushift = (uintmax_t) shift;
-
-       res = uval << ushift;
        return make_integer(res);
 }
 
@@ -2465,20 +2470,25 @@ do_rshift(int nargs)
        if (val < 0 || shift < 0)
                fatal(_("rshift(%f, %f): negative values are not allowed"), 
val, shift);
 
-       if (do_lint) {
-               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)
-                       lintwarn(_("rshift(%f, %f): too large shift value will 
give strange results"), val, shift);
+       if (do_lint && (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) {
+               // within range
+               uval = (uintmax_t) val;
+               ushift = (uintmax_t) shift;
+
+               res = uval >> ushift;
+       } else {
+               // out of range
+               if (do_lint)
+                       lintwarn(_("rshift(%f, %f): too large shift value 
returns zero"), val, shift);
+               res = 0;
        }
 
        DEREF(s1);
        DEREF(s2);
 
-       uval = (uintmax_t) val;
-       ushift = (uintmax_t) shift;
-
-       res = uval >> ushift;
        return make_integer(res);
 }
 
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 887c1442..ef084630 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-24         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * gawk.texi (Bitwise Functions): Document that lshift and rshift
+       now return zero for shifting by too many bits.
+
 2024-10-20         Arnold D. Robbins     <arnold@skeeve.com>
 
        * gawk.texi [PVERSION]: Nuked. All uses changed to straight
diff --git a/doc/gawk.info b/doc/gawk.info
index 4716e43c..2dc99c58 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -14700,6 +14700,12 @@ are enclosed in square brackets ([ ]):
      produces a fatal error.  See the sidebar "Beware The Smoke and
      Mirrors!"  for more information as to why.
 
+     Beginning with ‘gawk’ version 5.4, if not in MPFR mode (*note
+     Arbitrary Precision Arithmetic::), shifting with ‘lsfhit()’ or
+     ‘rshift()’ by as many or more bits than are available in the
+     largest unsigned integer returns zero, instead of whatever the
+     underlying C compiler might do.
+
    Here is a user-defined function (*note User-defined::) that
 illustrates the use of these functions:
 
@@ -14763,7 +14769,7 @@ Nondecimal-numbers::), and then demonstrates the 
results of the
 
                      Beware The Smoke and Mirrors!
 
-   It other languages, bitwise operations are performed on integer
+   In 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.
 
@@ -37086,7 +37092,7 @@ Index
 * BINMODE variable:                      User-modified.       (line  15)
 * BINMODE variable <1>:                  PC Using.            (line  18)
 * bit-manipulation functions:            Bitwise Functions.   (line   6)
-* bits2str() user-defined function:      Bitwise Functions.   (line  69)
+* bits2str() user-defined function:      Bitwise Functions.   (line  75)
 * bitwise, AND:                          Bitwise Functions.   (line  40)
 * bitwise, complement:                   Bitwise Functions.   (line  25)
 * bitwise, complement <1>:               Bitwise Functions.   (line  44)
@@ -37372,11 +37378,11 @@ Index
 * converting, integer array subscripts to strings: Numeric Array Subscripts.
                                                               (line  31)
 * converting, numbers to strings:        Strings And Numbers. (line   6)
-* converting, numbers to strings <1>:    Bitwise Functions.   (line 109)
+* converting, numbers to strings <1>:    Bitwise Functions.   (line 115)
 * converting, string to lower case:      String Functions.    (line 553)
 * converting, string to numbers:         Strings And Numbers. (line   6)
 * converting, string to numbers <1>:     String Functions.    (line 420)
-* converting, string to numbers <2>:     Bitwise Functions.   (line 109)
+* converting, string to numbers <2>:     Bitwise Functions.   (line 115)
 * converting, string to upper case:      String Functions.    (line 559)
 * CONVFMT variable:                      Strings And Numbers. (line  29)
 * CONVFMT variable <1>:                  User-modified.       (line  30)
@@ -38964,12 +38970,12 @@ Index
 * number sign (#), commenting:           Comments.            (line   6)
 * numbers, as array subscripts:          Numeric Array Subscripts.
                                                               (line   6)
-* numbers, as string of bits:            Bitwise Functions.   (line 109)
+* numbers, as string of bits:            Bitwise Functions.   (line 115)
 * numbers, as values of characters:      Ordinal Functions.   (line   6)
 * numbers, Cliff random:                 Cliff Random Function.
                                                               (line   6)
 * numbers, converting:                   Strings And Numbers. (line   6)
-* numbers, converting <1>:               Bitwise Functions.   (line 109)
+* numbers, converting <1>:               Bitwise Functions.   (line 115)
 * numbers, converting, to strings:       User-modified.       (line  30)
 * numbers, converting, to strings <1>:   User-modified.       (line 107)
 * numbers, hexadecimal:                  Nondecimal-numbers.  (line   6)
@@ -39627,7 +39633,7 @@ Index
                                                               (line  72)
 * sidebar, Backslash Before Regular Characters: Escape Sequences.
                                                               (line 122)
-* sidebar, Beware The Smoke and Mirrors!: Bitwise Functions.  (line 127)
+* sidebar, Beware The Smoke and Mirrors!: Bitwise Functions.  (line 133)
 * sidebar, Carriage-Return-Line-Feed Line Endings In CSV Files: Comma 
Separated Fields.
                                                               (line  45)
 * sidebar, Caveats When Using Regular Expressions for RS: gawk split records.
@@ -39780,7 +39786,7 @@ Index
 * string-translation functions:          I18N Functions.      (line   6)
 * strings, continuation across lines:    Scalar Constants.    (line  53)
 * strings, converting:                   Strings And Numbers. (line   6)
-* strings, converting <1>:               Bitwise Functions.   (line 109)
+* strings, converting <1>:               Bitwise Functions.   (line 115)
 * strings, converting, numbers to:       User-modified.       (line  30)
 * strings, converting, numbers to <1>:   User-modified.       (line 107)
 * strings, converting letter case:       String Functions.    (line 552)
@@ -39834,7 +39840,7 @@ Index
 * tee.awk program:                       Tee Program.         (line  26)
 * temporary breakpoint:                  Breakpoint Control.  (line  90)
 * terminating records:                   awk split records.   (line 118)
-* testbits.awk program:                  Bitwise Functions.   (line  69)
+* testbits.awk program:                  Bitwise Functions.   (line  75)
 * testext extension:                     Extension Sample API Tests.
                                                               (line   6)
 * Texinfo:                               Conventions.         (line   6)
@@ -39973,7 +39979,7 @@ Index
 * user-defined, function, _pw_init():    Passwd Functions.    (line 105)
 * user-defined, function, assert():      Assert Function.     (line  28)
 * user-defined, function, beginfile():   Filetrans Function.  (line  62)
-* user-defined, function, bits2str():    Bitwise Functions.   (line  69)
+* user-defined, function, bits2str():    Bitwise Functions.   (line  75)
 * user-defined, function, chr():         Ordinal Functions.   (line  16)
 * user-defined, function, cliff_rand():  Cliff Random Function.
                                                               (line  12)
@@ -40395,353 +40401,353 @@ Ref: Time Functions-Footnote-5643662
 Ref: Time Functions-Footnote-6643889
 Node: Bitwise Functions644167
 Ref: table-bitwise-ops644765
-Ref: Bitwise Functions-Footnote-1651007
-Ref: Bitwise Functions-Footnote-2651184
-Node: Type Functions651379
-Node: I18N Functions653550
-Node: User-defined655285
-Node: Definition Syntax656031
-Ref: Definition Syntax-Footnote-1661886
-Node: Function Example661961
-Ref: Function Example-Footnote-1664940
-Node: Function Calling664962
-Node: Calling A Function665554
-Node: Variable Scope666524
-Node: Pass By Value/Reference669578
-Node: Function Caveats672306
-Ref: Function Caveats-Footnote-1674397
-Node: Return Statement674517
-Node: Dynamic Typing677549
-Node: Dynamic Typing Awk678131
-Node: Dynamic Typing Gawk680269
-Node: Shadowed Variables683639
-Node: Indirect Calls685987
-Node: Functions Summary697128
-Node: Library Functions700094
-Ref: Library Functions-Footnote-1703642
-Ref: Library Functions-Footnote-2703787
-Node: Library Names703962
-Ref: Library Names-Footnote-1707733
-Ref: Library Names-Footnote-2707960
-Node: General Functions708054
-Node: Strtonum Function709324
-Node: Assert Function712406
-Node: Round Function715856
-Node: Cliff Random Function717428
-Node: Ordinal Functions718452
-Ref: Ordinal Functions-Footnote-1721555
-Ref: Ordinal Functions-Footnote-2721807
-Node: Join Function722021
-Ref: Join Function-Footnote-1723819
-Node: Getlocaltime Function724023
-Node: Readfile Function727797
-Node: Shell Quoting729826
-Node: Isnumeric Function731282
-Node: To CSV Function732718
-Node: Data File Management734810
-Node: Filetrans Function735442
-Node: Rewind Function739718
-Node: File Checking741689
-Ref: File Checking-Footnote-1743055
-Node: Empty Files743260
-Node: Ignoring Assigns745323
-Node: Getopt Function746897
-Ref: Getopt Function-Footnote-1762715
-Node: Passwd Functions762927
-Ref: Passwd Functions-Footnote-1772062
-Node: Group Functions772150
-Ref: Group Functions-Footnote-1780274
-Node: Walking Arrays780485
-Node: Library Functions Summary783531
-Node: Library Exercises784951
-Node: Sample Programs785436
-Node: Running Examples786218
-Node: Clones786970
-Node: Cut Program788238
-Node: Egrep Program798662
-Node: Id Program807961
-Node: Split Program818053
-Ref: Split Program-Footnote-1828266
-Node: Tee Program828451
-Node: Uniq Program831357
-Node: Wc Program839217
-Node: Bytes vs. Characters839612
-Node: Using extensions841212
-Node: wc program841990
-Node: Miscellaneous Programs846983
-Node: Dupword Program848208
-Node: Alarm Program850257
-Node: Translate Program855160
-Ref: Translate Program-Footnote-1859869
-Node: Labels Program860147
-Ref: Labels Program-Footnote-1863582
-Node: Word Sorting863666
-Node: History Sorting867840
-Node: Extract Program870113
-Node: Simple Sed878366
-Node: Igawk Program881576
-Ref: Igawk Program-Footnote-1896786
-Ref: Igawk Program-Footnote-2896992
-Ref: Igawk Program-Footnote-3897122
-Node: Anagram Program897249
-Node: Signature Program900335
-Node: Programs Summary901585
-Node: Programs Exercises902839
-Ref: Programs Exercises-Footnote-1907668
-Node: Advanced Features907754
-Node: Nondecimal Data910235
-Node: Boolean Typed Values911865
-Node: Array Sorting913822
-Node: Controlling Array Traversal914551
-Ref: Controlling Array Traversal-Footnote-1923054
-Node: Array Sorting Functions923176
-Ref: Array Sorting Functions-Footnote-1929273
-Node: Two-way I/O929481
-Ref: Two-way I/O-Footnote-1937452
-Ref: Two-way I/O-Footnote-2937643
-Node: TCP/IP Networking937725
-Node: Profiling940893
-Node: Persistent Memory950563
-Ref: Persistent Memory-Footnote-1960135
-Node: Extension Philosophy960266
-Node: Advanced Features Summary961793
-Node: Internationalization964059
-Node: I18N and L10N965761
-Node: Explaining gettext966456
-Ref: Explaining gettext-Footnote-1972592
-Ref: Explaining gettext-Footnote-2972785
-Node: Programmer i18n972950
-Ref: Programmer i18n-Footnote-1978062
-Node: Translator i18n978111
-Node: String Extraction978941
-Ref: String Extraction-Footnote-1980117
-Node: Printf Ordering980215
-Ref: Printf Ordering-Footnote-1983073
-Node: I18N Portability983141
-Ref: I18N Portability-Footnote-1985701
-Node: I18N Example985768
-Ref: I18N Example-Footnote-1989162
-Ref: I18N Example-Footnote-2989235
-Node: Gawk I18N989352
-Node: I18N Summary990006
-Node: Debugger991403
-Node: Debugging992423
-Node: Debugging Concepts992872
-Node: Debugging Terms994689
-Node: Awk Debugging997292
-Ref: Awk Debugging-Footnote-1998265
-Node: Sample Debugging Session998401
-Node: Debugger Invocation998951
-Node: Finding The Bug1000576
-Node: List of Debugger Commands1007208
-Node: Breakpoint Control1008585
-Node: Debugger Execution Control1012407
-Node: Viewing And Changing Data1015881
-Node: Execution Stack1019615
-Node: Debugger Info1021296
-Node: Miscellaneous Debugger Commands1025591
-Node: Readline Support1030832
-Node: Limitations1031776
-Node: Debugging Summary1034400
-Node: Namespaces1035699
-Node: Global Namespace1036939
-Node: Qualified Names1038373
-Node: Default Namespace1039408
-Node: Changing The Namespace1040181
-Node: Naming Rules1041863
-Node: Internal Name Management1043818
-Node: Namespace Example1044888
-Node: Inclusion For Namespaces1047467
-Node: Namespace And Features1049910
-Node: Namespace Summary1051372
-Node: Arbitrary Precision Arithmetic1052885
-Node: Computer Arithmetic1054404
-Ref: table-numeric-ranges1058329
-Ref: table-floating-point-ranges1058826
-Ref: Computer Arithmetic-Footnote-11059484
-Node: Math Definitions1059541
-Ref: table-ieee-formats1062573
-Node: MPFR features1063146
-Node: MPFR On Parole1063599
-Ref: MPFR On Parole-Footnote-11064440
-Node: MPFR Intro1064599
-Node: FP Math Caution1066283
-Ref: FP Math Caution-Footnote-11067355
-Node: Inexactness of computations1067728
-Node: Inexact representation1068759
-Node: Comparing FP Values1070140
-Node: Errors accumulate1071398
-Node: Strange values1072863
-Ref: Strange values-Footnote-11075517
-Node: Getting Accuracy1075622
-Node: Try To Round1078359
-Node: Setting precision1079266
-Ref: table-predefined-precision-strings1079971
-Node: Setting the rounding mode1081855
-Ref: table-gawk-rounding-modes1082237
-Ref: Setting the rounding mode-Footnote-11086289
-Node: Arbitrary Precision Integers1086474
-Ref: Arbitrary Precision Integers-Footnote-11089684
-Node: Checking for MPFR1089837
-Node: POSIX Floating Point Problems1091327
-Ref: POSIX Floating Point Problems-Footnote-11096147
-Node: Floating point summary1096185
-Node: Dynamic Extensions1098441
-Node: Extension Intro1100038
-Node: Plugin License1101340
-Node: Extension Mechanism Outline1102153
-Ref: figure-load-extension1102604
-Ref: figure-register-new-function1104182
-Ref: figure-call-new-function1105291
-Node: Extension API Description1107406
-Node: Extension API Functions Introduction1109135
-Ref: table-api-std-headers1111029
-Node: General Data Types1115470
-Ref: General Data Types-Footnote-11124616
-Node: Memory Allocation Functions1124919
-Ref: Memory Allocation Functions-Footnote-11129634
-Node: Constructor Functions1129733
-Node: API Ownership of MPFR and GMP Values1133634
-Node: Registration Functions1135187
-Node: Extension Functions1135891
-Node: Exit Callback Functions1141465
-Node: Extension Version String1142779
-Node: Input Parsers1143474
-Node: Output Wrappers1158093
-Node: Two-way processors1162935
-Node: Printing Messages1165288
-Ref: Printing Messages-Footnote-11166499
-Node: Updating ERRNO1166652
-Node: Requesting Values1167451
-Ref: table-value-types-returned1168204
-Node: Accessing Parameters1170263
-Node: Symbol Table Access1171544
-Node: Symbol table by name1172056
-Ref: Symbol table by name-Footnote-11175257
-Node: Symbol table by cookie1175389
-Ref: Symbol table by cookie-Footnote-11179658
-Node: Cached values1179722
-Ref: Cached values-Footnote-11183354
-Node: Array Manipulation1183511
-Ref: Array Manipulation-Footnote-11184610
-Node: Array Data Types1184647
-Ref: Array Data Types-Footnote-11187465
-Node: Array Functions1187561
-Node: Flattening Arrays1192590
-Node: Creating Arrays1199638
-Node: Redirection API1204480
-Node: Extension API Variables1207497
-Node: Extension Versioning1208220
-Ref: gawk-api-version1208649
-Node: Extension GMP/MPFR Versioning1210436
-Node: Extension API Informational Variables1212140
-Node: Extension API Boilerplate1213393
-Node: Changes from API V11217523
-Node: Finding Extensions1219155
-Node: Extension Example1219730
-Node: Internal File Description1220552
-Node: Internal File Ops1224844
-Ref: Internal File Ops-Footnote-11236394
-Node: Using Internal File Ops1236542
-Ref: Using Internal File Ops-Footnote-11238975
-Node: Extension Samples1239253
-Node: Extension Sample File Functions1240822
-Node: Extension Sample Fnmatch1248947
-Node: Extension Sample Fork1250542
-Node: Extension Sample Inplace1251818
-Node: Extension Sample Ord1255920
-Node: Extension Sample Readdir1256796
-Ref: table-readdir-file-types1257585
-Node: Extension Sample Revout1258941
-Node: Extension Sample Rev2way1259538
-Node: Extension Sample Read write array1260290
-Node: Extension Sample Readfile1263564
-Node: Extension Sample Time1264695
-Node: Extension Sample API Tests1266695
-Node: gawkextlib1267203
-Node: Extension summary1270235
-Node: Extension Exercises1274083
-Node: Language History1275353
-Node: V7/SVR3.11277065
-Node: SVR41279415
-Node: POSIX1280947
-Node: BTL1282372
-Node: POSIX/GNU1283139
-Ref: Gawk Extension Functions1286529
-Node: Feature History1289953
-Node: Common Extensions1309985
-Node: Ranges and Locales1311460
-Ref: Ranges and Locales-Footnote-11316245
-Ref: Ranges and Locales-Footnote-21316272
-Ref: Ranges and Locales-Footnote-31316507
-Node: Contributors1316730
-Node: History summary1323082
-Node: Installation1324524
-Node: Gawk Distribution1325488
-Node: Getting1325980
-Node: Extracting1326979
-Node: Distribution contents1328685
-Node: Unix Installation1336575
-Node: Quick Installation1337395
-Node: Compiling with MPFR1339935
-Node: Shell Startup Files1340641
-Node: Additional Configuration Options1341798
-Node: Configuration Philosophy1344181
-Node: Compiling from Git1346681
-Node: Building the Documentation1347240
-Node: Non-Unix Installation1348652
-Node: PC Installation1349128
-Node: PC Binary Installation1349997
-Node: PC Compiling1350890
-Node: PC Using1352068
-Node: Cygwin1355784
-Node: MSYS1357036
-Node: OpenVMS Installation1357662
-Node: OpenVMS Compilation1358343
-Ref: OpenVMS Compilation-Footnote-11359826
-Node: OpenVMS Dynamic Extensions1359884
-Node: OpenVMS Installation Details1361520
-Node: OpenVMS Running1363951
-Node: OpenVMS GNV1368088
-Node: Bugs1368843
-Node: Bug definition1369763
-Node: Bug address1373364
-Node: Usenet1376933
-Node: Performance bugs1378146
-Node: Asking for help1381150
-Node: Maintainers1383137
-Node: Other Versions1384164
-Node: Installation summary1394153
-Node: Notes1395535
-Node: Compatibility Mode1396345
-Node: Additions1397167
-Node: Accessing The Source1398112
-Node: Adding Code1399643
-Node: New Ports1406754
-Node: Derived Files1411257
-Ref: Derived Files-Footnote-11417068
-Ref: Derived Files-Footnote-21417103
-Ref: Derived Files-Footnote-31417714
-Node: Future Extensions1417828
-Node: Implementation Limitations1418498
-Node: Extension Design1419740
-Node: Old Extension Problems1420900
-Ref: Old Extension Problems-Footnote-11422472
-Node: Extension New Mechanism Goals1422533
-Ref: Extension New Mechanism Goals-Footnote-11426003
-Node: Extension Other Design Decisions1426204
-Node: Extension Future Growth1428401
-Node: Notes summary1429021
-Node: Basic Concepts1430231
-Node: Basic High Level1430916
-Ref: figure-general-flow1431198
-Ref: figure-process-flow1431900
-Ref: Basic High Level-Footnote-11435270
-Node: Basic Data Typing1435459
-Node: Glossary1438867
-Node: Copying1471745
-Node: GNU Free Documentation License1509303
-Node: Index1534426
+Ref: Bitwise Functions-Footnote-1651326
+Ref: Bitwise Functions-Footnote-2651503
+Node: Type Functions651698
+Node: I18N Functions653869
+Node: User-defined655604
+Node: Definition Syntax656350
+Ref: Definition Syntax-Footnote-1662205
+Node: Function Example662280
+Ref: Function Example-Footnote-1665259
+Node: Function Calling665281
+Node: Calling A Function665873
+Node: Variable Scope666843
+Node: Pass By Value/Reference669897
+Node: Function Caveats672625
+Ref: Function Caveats-Footnote-1674716
+Node: Return Statement674836
+Node: Dynamic Typing677868
+Node: Dynamic Typing Awk678450
+Node: Dynamic Typing Gawk680588
+Node: Shadowed Variables683958
+Node: Indirect Calls686306
+Node: Functions Summary697447
+Node: Library Functions700413
+Ref: Library Functions-Footnote-1703961
+Ref: Library Functions-Footnote-2704106
+Node: Library Names704281
+Ref: Library Names-Footnote-1708052
+Ref: Library Names-Footnote-2708279
+Node: General Functions708373
+Node: Strtonum Function709643
+Node: Assert Function712725
+Node: Round Function716175
+Node: Cliff Random Function717747
+Node: Ordinal Functions718771
+Ref: Ordinal Functions-Footnote-1721874
+Ref: Ordinal Functions-Footnote-2722126
+Node: Join Function722340
+Ref: Join Function-Footnote-1724138
+Node: Getlocaltime Function724342
+Node: Readfile Function728116
+Node: Shell Quoting730145
+Node: Isnumeric Function731601
+Node: To CSV Function733037
+Node: Data File Management735129
+Node: Filetrans Function735761
+Node: Rewind Function740037
+Node: File Checking742008
+Ref: File Checking-Footnote-1743374
+Node: Empty Files743579
+Node: Ignoring Assigns745642
+Node: Getopt Function747216
+Ref: Getopt Function-Footnote-1763034
+Node: Passwd Functions763246
+Ref: Passwd Functions-Footnote-1772381
+Node: Group Functions772469
+Ref: Group Functions-Footnote-1780593
+Node: Walking Arrays780804
+Node: Library Functions Summary783850
+Node: Library Exercises785270
+Node: Sample Programs785755
+Node: Running Examples786537
+Node: Clones787289
+Node: Cut Program788557
+Node: Egrep Program798981
+Node: Id Program808280
+Node: Split Program818372
+Ref: Split Program-Footnote-1828585
+Node: Tee Program828770
+Node: Uniq Program831676
+Node: Wc Program839536
+Node: Bytes vs. Characters839931
+Node: Using extensions841531
+Node: wc program842309
+Node: Miscellaneous Programs847302
+Node: Dupword Program848527
+Node: Alarm Program850576
+Node: Translate Program855479
+Ref: Translate Program-Footnote-1860188
+Node: Labels Program860466
+Ref: Labels Program-Footnote-1863901
+Node: Word Sorting863985
+Node: History Sorting868159
+Node: Extract Program870432
+Node: Simple Sed878685
+Node: Igawk Program881895
+Ref: Igawk Program-Footnote-1897105
+Ref: Igawk Program-Footnote-2897311
+Ref: Igawk Program-Footnote-3897441
+Node: Anagram Program897568
+Node: Signature Program900654
+Node: Programs Summary901904
+Node: Programs Exercises903158
+Ref: Programs Exercises-Footnote-1907987
+Node: Advanced Features908073
+Node: Nondecimal Data910554
+Node: Boolean Typed Values912184
+Node: Array Sorting914141
+Node: Controlling Array Traversal914870
+Ref: Controlling Array Traversal-Footnote-1923373
+Node: Array Sorting Functions923495
+Ref: Array Sorting Functions-Footnote-1929592
+Node: Two-way I/O929800
+Ref: Two-way I/O-Footnote-1937771
+Ref: Two-way I/O-Footnote-2937962
+Node: TCP/IP Networking938044
+Node: Profiling941212
+Node: Persistent Memory950882
+Ref: Persistent Memory-Footnote-1960454
+Node: Extension Philosophy960585
+Node: Advanced Features Summary962112
+Node: Internationalization964378
+Node: I18N and L10N966080
+Node: Explaining gettext966775
+Ref: Explaining gettext-Footnote-1972911
+Ref: Explaining gettext-Footnote-2973104
+Node: Programmer i18n973269
+Ref: Programmer i18n-Footnote-1978381
+Node: Translator i18n978430
+Node: String Extraction979260
+Ref: String Extraction-Footnote-1980436
+Node: Printf Ordering980534
+Ref: Printf Ordering-Footnote-1983392
+Node: I18N Portability983460
+Ref: I18N Portability-Footnote-1986020
+Node: I18N Example986087
+Ref: I18N Example-Footnote-1989481
+Ref: I18N Example-Footnote-2989554
+Node: Gawk I18N989671
+Node: I18N Summary990325
+Node: Debugger991722
+Node: Debugging992742
+Node: Debugging Concepts993191
+Node: Debugging Terms995008
+Node: Awk Debugging997611
+Ref: Awk Debugging-Footnote-1998584
+Node: Sample Debugging Session998720
+Node: Debugger Invocation999270
+Node: Finding The Bug1000895
+Node: List of Debugger Commands1007527
+Node: Breakpoint Control1008904
+Node: Debugger Execution Control1012726
+Node: Viewing And Changing Data1016200
+Node: Execution Stack1019934
+Node: Debugger Info1021615
+Node: Miscellaneous Debugger Commands1025910
+Node: Readline Support1031151
+Node: Limitations1032095
+Node: Debugging Summary1034719
+Node: Namespaces1036018
+Node: Global Namespace1037258
+Node: Qualified Names1038692
+Node: Default Namespace1039727
+Node: Changing The Namespace1040500
+Node: Naming Rules1042182
+Node: Internal Name Management1044137
+Node: Namespace Example1045207
+Node: Inclusion For Namespaces1047786
+Node: Namespace And Features1050229
+Node: Namespace Summary1051691
+Node: Arbitrary Precision Arithmetic1053204
+Node: Computer Arithmetic1054723
+Ref: table-numeric-ranges1058648
+Ref: table-floating-point-ranges1059145
+Ref: Computer Arithmetic-Footnote-11059803
+Node: Math Definitions1059860
+Ref: table-ieee-formats1062892
+Node: MPFR features1063465
+Node: MPFR On Parole1063918
+Ref: MPFR On Parole-Footnote-11064759
+Node: MPFR Intro1064918
+Node: FP Math Caution1066602
+Ref: FP Math Caution-Footnote-11067674
+Node: Inexactness of computations1068047
+Node: Inexact representation1069078
+Node: Comparing FP Values1070459
+Node: Errors accumulate1071717
+Node: Strange values1073182
+Ref: Strange values-Footnote-11075836
+Node: Getting Accuracy1075941
+Node: Try To Round1078678
+Node: Setting precision1079585
+Ref: table-predefined-precision-strings1080290
+Node: Setting the rounding mode1082174
+Ref: table-gawk-rounding-modes1082556
+Ref: Setting the rounding mode-Footnote-11086608
+Node: Arbitrary Precision Integers1086793
+Ref: Arbitrary Precision Integers-Footnote-11090003
+Node: Checking for MPFR1090156
+Node: POSIX Floating Point Problems1091646
+Ref: POSIX Floating Point Problems-Footnote-11096466
+Node: Floating point summary1096504
+Node: Dynamic Extensions1098760
+Node: Extension Intro1100357
+Node: Plugin License1101659
+Node: Extension Mechanism Outline1102472
+Ref: figure-load-extension1102923
+Ref: figure-register-new-function1104501
+Ref: figure-call-new-function1105610
+Node: Extension API Description1107725
+Node: Extension API Functions Introduction1109454
+Ref: table-api-std-headers1111348
+Node: General Data Types1115789
+Ref: General Data Types-Footnote-11124935
+Node: Memory Allocation Functions1125238
+Ref: Memory Allocation Functions-Footnote-11129953
+Node: Constructor Functions1130052
+Node: API Ownership of MPFR and GMP Values1133953
+Node: Registration Functions1135506
+Node: Extension Functions1136210
+Node: Exit Callback Functions1141784
+Node: Extension Version String1143098
+Node: Input Parsers1143793
+Node: Output Wrappers1158412
+Node: Two-way processors1163254
+Node: Printing Messages1165607
+Ref: Printing Messages-Footnote-11166818
+Node: Updating ERRNO1166971
+Node: Requesting Values1167770
+Ref: table-value-types-returned1168523
+Node: Accessing Parameters1170582
+Node: Symbol Table Access1171863
+Node: Symbol table by name1172375
+Ref: Symbol table by name-Footnote-11175576
+Node: Symbol table by cookie1175708
+Ref: Symbol table by cookie-Footnote-11179977
+Node: Cached values1180041
+Ref: Cached values-Footnote-11183673
+Node: Array Manipulation1183830
+Ref: Array Manipulation-Footnote-11184929
+Node: Array Data Types1184966
+Ref: Array Data Types-Footnote-11187784
+Node: Array Functions1187880
+Node: Flattening Arrays1192909
+Node: Creating Arrays1199957
+Node: Redirection API1204799
+Node: Extension API Variables1207816
+Node: Extension Versioning1208539
+Ref: gawk-api-version1208968
+Node: Extension GMP/MPFR Versioning1210755
+Node: Extension API Informational Variables1212459
+Node: Extension API Boilerplate1213712
+Node: Changes from API V11217842
+Node: Finding Extensions1219474
+Node: Extension Example1220049
+Node: Internal File Description1220871
+Node: Internal File Ops1225163
+Ref: Internal File Ops-Footnote-11236713
+Node: Using Internal File Ops1236861
+Ref: Using Internal File Ops-Footnote-11239294
+Node: Extension Samples1239572
+Node: Extension Sample File Functions1241141
+Node: Extension Sample Fnmatch1249266
+Node: Extension Sample Fork1250861
+Node: Extension Sample Inplace1252137
+Node: Extension Sample Ord1256239
+Node: Extension Sample Readdir1257115
+Ref: table-readdir-file-types1257904
+Node: Extension Sample Revout1259260
+Node: Extension Sample Rev2way1259857
+Node: Extension Sample Read write array1260609
+Node: Extension Sample Readfile1263883
+Node: Extension Sample Time1265014
+Node: Extension Sample API Tests1267014
+Node: gawkextlib1267522
+Node: Extension summary1270554
+Node: Extension Exercises1274402
+Node: Language History1275672
+Node: V7/SVR3.11277384
+Node: SVR41279734
+Node: POSIX1281266
+Node: BTL1282691
+Node: POSIX/GNU1283458
+Ref: Gawk Extension Functions1286848
+Node: Feature History1290272
+Node: Common Extensions1310304
+Node: Ranges and Locales1311779
+Ref: Ranges and Locales-Footnote-11316564
+Ref: Ranges and Locales-Footnote-21316591
+Ref: Ranges and Locales-Footnote-31316826
+Node: Contributors1317049
+Node: History summary1323401
+Node: Installation1324843
+Node: Gawk Distribution1325807
+Node: Getting1326299
+Node: Extracting1327298
+Node: Distribution contents1329004
+Node: Unix Installation1336894
+Node: Quick Installation1337714
+Node: Compiling with MPFR1340254
+Node: Shell Startup Files1340960
+Node: Additional Configuration Options1342117
+Node: Configuration Philosophy1344500
+Node: Compiling from Git1347000
+Node: Building the Documentation1347559
+Node: Non-Unix Installation1348971
+Node: PC Installation1349447
+Node: PC Binary Installation1350316
+Node: PC Compiling1351209
+Node: PC Using1352387
+Node: Cygwin1356103
+Node: MSYS1357355
+Node: OpenVMS Installation1357981
+Node: OpenVMS Compilation1358662
+Ref: OpenVMS Compilation-Footnote-11360145
+Node: OpenVMS Dynamic Extensions1360203
+Node: OpenVMS Installation Details1361839
+Node: OpenVMS Running1364270
+Node: OpenVMS GNV1368407
+Node: Bugs1369162
+Node: Bug definition1370082
+Node: Bug address1373683
+Node: Usenet1377252
+Node: Performance bugs1378465
+Node: Asking for help1381469
+Node: Maintainers1383456
+Node: Other Versions1384483
+Node: Installation summary1394472
+Node: Notes1395854
+Node: Compatibility Mode1396664
+Node: Additions1397486
+Node: Accessing The Source1398431
+Node: Adding Code1399962
+Node: New Ports1407073
+Node: Derived Files1411576
+Ref: Derived Files-Footnote-11417387
+Ref: Derived Files-Footnote-21417422
+Ref: Derived Files-Footnote-31418033
+Node: Future Extensions1418147
+Node: Implementation Limitations1418817
+Node: Extension Design1420059
+Node: Old Extension Problems1421219
+Ref: Old Extension Problems-Footnote-11422791
+Node: Extension New Mechanism Goals1422852
+Ref: Extension New Mechanism Goals-Footnote-11426322
+Node: Extension Other Design Decisions1426523
+Node: Extension Future Growth1428720
+Node: Notes summary1429340
+Node: Basic Concepts1430550
+Node: Basic High Level1431235
+Ref: figure-general-flow1431517
+Ref: figure-process-flow1432219
+Ref: Basic High Level-Footnote-11435589
+Node: Basic Data Typing1435778
+Node: Glossary1439186
+Node: Copying1472064
+Node: GNU Free Documentation License1509622
+Node: Index1534745
 
 End Tag Table
 
diff --git a/doc/gawk.texi b/doc/gawk.texi
index b76e8c12..3fdfcbb4 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -20306,6 +20306,12 @@ Beginning with @command{gawk} 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.
+
+Beginning with @command{gawk} version 5.4, if not in MPFR mode
+(@pxref{Arbitrary Precision Arithmetic}), shifting with @code{lsfhit()}
+or @code{rshift()} by as many or more bits than are available in the
+largest unsigned integer returns zero, instead of whatever the underlying
+C compiler might do.
 @end quotation
 
 Here is a user-defined function (@pxref{User-defined})
@@ -20416,7 +20422,7 @@ results of the @code{compl()}, @code{lshift()}, and 
@code{rshift()} functions.
 @cindex sidebar @subentry Beware The Smoke and Mirrors!
 @cartouche Beware The Smoke and Mirrors!
 
-It other languages, bitwise operations are performed on integer values,
+In 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.
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog     |   9 +-
 NEWS          |   4 +
 builtin.c     |  46 ++--
 doc/ChangeLog |   5 +
 doc/gawk.info | 720 +++++++++++++++++++++++++++++-----------------------------
 doc/gawk.texi |   8 +-
 6 files changed, 415 insertions(+), 377 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]