git: 44d4804d1945 - main - =?utf-8?Q?usr.bin/gh=C3=A4-bc, contrib/bc: update to version 5.0.0?=

Stefan Eßer se at FreeBSD.org
Fri Aug 13 09:52:51 UTC 2021


The branch main has been updated by se:

URL: https://cgit.FreeBSD.org/src/commit/?id=44d4804d1945435745518cd09eb8ae6ab22ecef4

commit 44d4804d1945435745518cd09eb8ae6ab22ecef4
Author:     Stefan Eßer <se at FreeBSD.org>
AuthorDate: 2021-08-10 08:42:54 +0000
Commit:     Stefan Eßer <se at FreeBSD.org>
CommitDate: 2021-08-13 09:28:06 +0000

    usr.bin/ghä-bc, contrib/bc: update to version 5.0.0
    
    Merge commit 2f57ecae4b98e76e5d675563785a7e6c59c868c4
    
    This is a new major release with a number of changes and extensions:
    
    - Limited the number of temporary numbers and made the space for them
      static so that allocating more space for them cannot fail.
    - Allowed integers with non-zero scale to be used with power, places,
      and shift operators.
    - Added greatest common divisor and least common multiple to lib2.bc.
    - Made bc and dc UTF-8 capable.
    - Added the ability for users to have bc and dc quit on SIGINT.
    - Added the ability for users to disable prompt and TTY mode by
      environment variables.
    - Added the ability for users to redefine keywords.
    - Added dc's modular exponentiation and divmod to bc.
    - Added the ability to assign strings to variables and array elements
      and pass them to functions in bc.
    - Added dc's asciify command and stream printing to bc.
    - Added bitwise and, or, xor, left shift, right shift, reverse,
      left rotate, right rotate, and mod functions to lib2.bc.
    - Added the functions s2u(x) and s2un(x,n), to lib2.bc.
    
    MFC after:      1 week
---
 contrib/bc/.gitattributes                          |    2 +-
 contrib/bc/.gitignore                              |    8 +-
 contrib/bc/LICENSE.md                              |   14 +-
 contrib/bc/Makefile.in                             |  217 +-
 contrib/bc/NEWS.md                                 |   61 +-
 contrib/bc/README.md                               |   50 +-
 contrib/bc/RELEASE.md                              |   54 -
 contrib/bc/bc.vcxproj                              |   80 +-
 contrib/bc/bcl.vcxproj                             |   24 +-
 contrib/bc/benchmarks/bc/add.bc                    |   21 +
 .../fuzzing/bc.dict => benchmarks/bc/arrays.bc}    |   44 +-
 contrib/bc/benchmarks/bc/arrays_and_constants.bc   |   35 +
 contrib/bc/benchmarks/bc/bitfuncs.bc               |   18 +
 .../{tests/diff.sh => benchmarks/bc/constants.bc}  |   30 +-
 contrib/bc/benchmarks/bc/divide.bc                 |   26 +
 contrib/bc/benchmarks/bc/functions.bc              |   34 +
 contrib/bc/benchmarks/bc/irand_long.bc             |    9 +
 contrib/bc/benchmarks/bc/irand_short.bc            |    5 +
 contrib/bc/benchmarks/bc/lib.bc                    |    7 +
 contrib/bc/benchmarks/bc/multiply.bc               |   23 +
 contrib/bc/benchmarks/bc/postfix_incdec.bc         |    7 +
 contrib/bc/benchmarks/bc/power.bc                  |    2 +
 contrib/bc/benchmarks/bc/strings.bc                |   36 +
 contrib/bc/benchmarks/bc/subtract.bc               |   22 +
 contrib/bc/benchmarks/dc/modexp.dc                 |   42 +
 contrib/bc/configure                               | 1322 +----
 contrib/bc/configure.sh                            |  383 +-
 contrib/bc/gen/bc_help.txt                         |   52 +
 contrib/bc/gen/dc_help.txt                         |   30 +
 contrib/bc/gen/lib.bc                              |    2 +-
 contrib/bc/gen/lib2.bc                             |  247 +-
 contrib/bc/gen/strgen.c                            |  112 +-
 contrib/bc/gen/strgen.sh                           |    3 +
 contrib/bc/include/args.h                          |   11 +-
 contrib/bc/include/bc.h                            |  302 +-
 contrib/bc/include/bcl.h                           |  139 +-
 contrib/bc/include/dc.h                            |   42 +-
 contrib/bc/include/file.h                          |   88 +
 contrib/bc/include/history.h                       |  106 +-
 contrib/bc/include/lang.h                          |  432 +-
 contrib/bc/include/lex.h                           |  362 +-
 contrib/bc/include/library.h                       |   90 +-
 contrib/bc/include/num.h                           |  646 ++-
 contrib/bc/include/opt.h                           |   61 +
 contrib/bc/include/parse.h                         |  182 +-
 contrib/bc/include/program.h                       |  812 ++-
 contrib/bc/include/rand.h                          |  326 +-
 contrib/bc/include/read.h                          |   42 +-
 contrib/bc/include/status.h                        |  642 ++-
 contrib/bc/include/vector.h                        |  378 +-
 contrib/bc/include/version.h                       |    5 +-
 contrib/bc/include/vm.h                            |  680 ++-
 contrib/bc/locales/de_DE.ISO8859-1.msg             |   13 +-
 contrib/bc/locales/de_DE.UTF-8.msg                 |   13 +-
 contrib/bc/locales/en_US.msg                       |   13 +-
 contrib/bc/locales/es_ES.ISO8859-1.msg             |   13 +-
 contrib/bc/locales/es_ES.UTF-8.msg                 |   13 +-
 contrib/bc/locales/fr_FR.ISO8859-1.msg             |   13 +-
 contrib/bc/locales/fr_FR.UTF-8.msg                 |   13 +-
 contrib/bc/locales/ja_JP.UTF-8.msg                 |   32 +-
 contrib/bc/locales/ja_JP.eucJP.msg                 |   32 +-
 contrib/bc/locales/nl_NL.ISO8859-1.msg             |   22 +-
 contrib/bc/locales/nl_NL.UTF-8.msg                 |   22 +-
 contrib/bc/locales/pl_PL.ISO8859-2.msg             |   22 +-
 contrib/bc/locales/pl_PL.UTF-8.msg                 |   22 +-
 contrib/bc/locales/pt_PT.ISO8859-1.msg             |   13 +-
 contrib/bc/locales/pt_PT.UTF-8.msg                 |   13 +-
 contrib/bc/locales/ru_RU.CP1251.msg                |   22 +-
 contrib/bc/locales/ru_RU.CP866.msg                 |   22 +-
 contrib/bc/locales/ru_RU.ISO8859-5.msg             |   22 +-
 contrib/bc/locales/ru_RU.KOI8-R.msg                |   15 +-
 contrib/bc/locales/ru_RU.UTF-8.msg                 |   22 +-
 contrib/bc/locales/zh_CN.GB18030.msg               |   17 +-
 contrib/bc/locales/zh_CN.GB2312.msg                |   17 +-
 contrib/bc/locales/zh_CN.GBK.msg                   |   17 +-
 contrib/bc/locales/zh_CN.UTF-8.msg                 |   15 +-
 contrib/bc/locales/zh_CN.eucCN.msg                 |   17 +-
 contrib/bc/manpage.sh                              |  131 -
 contrib/bc/manuals/algorithms.md                   |  162 +-
 contrib/bc/manuals/bc.1.md.in                      | 1840 -------
 contrib/bc/manuals/bc/A.1                          | 2575 ++++++----
 contrib/bc/manuals/bc/A.1.md                       |  663 ++-
 contrib/bc/manuals/bc/E.1                          | 1287 +++--
 contrib/bc/manuals/bc/E.1.md                       |  324 +-
 contrib/bc/manuals/bc/EH.1                         | 1258 +++--
 contrib/bc/manuals/bc/EH.1.md                      |  296 +-
 contrib/bc/manuals/bc/EHN.1                        | 1258 +++--
 contrib/bc/manuals/bc/EHN.1.md                     |  296 +-
 contrib/bc/manuals/bc/EHNP.1                       | 1375 -----
 contrib/bc/manuals/bc/EHNP.1.md                    | 1069 ----
 contrib/bc/manuals/bc/EHP.1                        | 1382 -----
 contrib/bc/manuals/bc/EHP.1.md                     | 1077 ----
 contrib/bc/manuals/bc/EN.1                         | 1287 +++--
 contrib/bc/manuals/bc/EN.1.md                      |  324 +-
 contrib/bc/manuals/bc/ENP.1                        | 1393 -----
 contrib/bc/manuals/bc/ENP.1.md                     | 1085 ----
 contrib/bc/manuals/bc/EP.1                         | 1400 -----
 contrib/bc/manuals/bc/EP.1.md                      | 1093 ----
 contrib/bc/manuals/bc/H.1                          | 2548 +++++----
 contrib/bc/manuals/bc/H.1.md                       |  640 ++-
 contrib/bc/manuals/bc/HN.1                         | 2548 +++++----
 contrib/bc/manuals/bc/HN.1.md                      |  640 ++-
 contrib/bc/manuals/bc/HNP.1                        | 2223 --------
 contrib/bc/manuals/bc/HNP.1.md                     | 1679 ------
 contrib/bc/manuals/bc/HP.1                         | 2230 --------
 contrib/bc/manuals/bc/HP.1.md                      | 1687 ------
 contrib/bc/manuals/bc/N.1                          | 2575 ++++++----
 contrib/bc/manuals/bc/N.1.md                       |  663 ++-
 contrib/bc/manuals/bc/NP.1                         | 2243 --------
 contrib/bc/manuals/bc/NP.1.md                      | 1696 ------
 contrib/bc/manuals/bc/P.1                          | 2250 --------
 contrib/bc/manuals/bc/P.1.md                       | 1704 ------
 contrib/bc/manuals/bcl.3                           | 1757 +++----
 contrib/bc/manuals/bcl.3.md                        |  253 +-
 contrib/bc/manuals/benchmarks.md                   |  673 ---
 contrib/bc/manuals/build.md                        |  207 +-
 contrib/bc/manuals/dc.1.md.in                      | 1289 -----
 contrib/bc/manuals/dc/A.1                          | 1606 +++---
 contrib/bc/manuals/dc/A.1.md                       |  237 +-
 contrib/bc/manuals/dc/E.1                          | 1418 +++--
 contrib/bc/manuals/dc/E.1.md                       |  237 +-
 contrib/bc/manuals/dc/EH.1                         | 1387 +++--
 contrib/bc/manuals/dc/EH.1.md                      |  213 +-
 contrib/bc/manuals/dc/EHN.1                        | 1387 +++--
 contrib/bc/manuals/dc/EHN.1.md                     |  211 +-
 contrib/bc/manuals/dc/EHNP.1                       | 1307 -----
 contrib/bc/manuals/dc/EHNP.1.md                    | 1023 ----
 contrib/bc/manuals/dc/EHP.1                        | 1311 -----
 contrib/bc/manuals/dc/EHP.1.md                     | 1028 ----
 contrib/bc/manuals/dc/EN.1                         | 1416 +++--
 contrib/bc/manuals/dc/EN.1.md                      |  235 +-
 contrib/bc/manuals/dc/ENP.1                        | 1322 -----
 contrib/bc/manuals/dc/ENP.1.md                     | 1036 ----
 contrib/bc/manuals/dc/EP.1                         | 1326 -----
 contrib/bc/manuals/dc/EP.1.md                      | 1041 ----
 contrib/bc/manuals/dc/H.1                          | 1575 +++---
 contrib/bc/manuals/dc/H.1.md                       |  213 +-
 contrib/bc/manuals/dc/HN.1                         | 1575 +++---
 contrib/bc/manuals/dc/HN.1.md                      |  211 +-
 contrib/bc/manuals/dc/HNP.1                        | 1536 ------
 contrib/bc/manuals/dc/HNP.1.md                     | 1190 -----
 contrib/bc/manuals/dc/HP.1                         | 1540 ------
 contrib/bc/manuals/dc/HP.1.md                      | 1195 -----
 contrib/bc/manuals/dc/N.1                          | 1604 +++---
 contrib/bc/manuals/dc/N.1.md                       |  235 +-
 contrib/bc/manuals/dc/NP.1                         | 1551 ------
 contrib/bc/manuals/dc/NP.1.md                      | 1203 -----
 contrib/bc/manuals/dc/P.1                          | 1555 ------
 contrib/bc/manuals/dc/P.1.md                       | 1208 -----
 contrib/bc/manuals/development.md                  | 4950 ++++++++++++++++++
 contrib/bc/manuals/header.txt                      |   27 -
 contrib/bc/manuals/header_bc.txt                   |    1 -
 contrib/bc/manuals/header_bcl.txt                  |    1 -
 contrib/bc/manuals/header_dc.txt                   |    1 -
 contrib/bc/manuals/release.md                      |   72 +
 contrib/bc/{tests => scripts}/afl.py               |   77 +-
 contrib/bc/scripts/alloc.sh                        |   84 +
 contrib/bc/scripts/benchmark.sh                    |  159 +
 contrib/bc/scripts/bitgen.c                        |  101 +
 contrib/bc/{ => scripts}/exec-install.sh           |    6 +-
 contrib/bc/{ => scripts}/functions.sh              |   68 +-
 contrib/bc/scripts/fuzz_prep.sh                    |   81 +
 contrib/bc/{ => scripts}/karatsuba.py              |   29 +-
 contrib/bc/{ => scripts}/link.sh                   |    5 +-
 contrib/bc/{ => scripts}/locale_install.sh         |   53 +-
 contrib/bc/{ => scripts}/locale_uninstall.sh       |    1 +
 contrib/bc/scripts/manpage.sh                      |  175 +
 contrib/bc/scripts/ministat.c                      |  670 +++
 contrib/bc/scripts/package.sh                      |  173 +
 contrib/bc/{tests => scripts}/radamsa.sh           |   29 +-
 contrib/bc/{tests => scripts}/radamsa.txt          |    0
 contrib/bc/{tests => scripts}/randmath.py          |  145 +-
 contrib/bc/{ => scripts}/release.sh                |  290 +-
 contrib/bc/scripts/release_settings.txt            |   16 +
 contrib/bc/{ => scripts}/safe-install.sh           |    0
 contrib/bc/scripts/test_settings.sh                |   77 +
 contrib/bc/scripts/test_settings.txt               |   93 +
 contrib/bc/src/args.c                              |  118 +-
 contrib/bc/src/bc.c                                |   11 +-
 contrib/bc/src/bc_lex.c                            |   84 +-
 contrib/bc/src/bc_parse.c                          |  866 +++-
 contrib/bc/src/data.c                              |  447 +-
 contrib/bc/src/dc.c                                |   11 +-
 contrib/bc/src/dc_lex.c                            |   91 +-
 contrib/bc/src/dc_parse.c                          |   93 +-
 contrib/bc/src/file.c                              |   63 +-
 contrib/bc/src/history.c                           |  648 ++-
 contrib/bc/src/lang.c                              |  131 +-
 contrib/bc/src/lex.c                               |  123 +-
 contrib/bc/src/library.c                           |  172 +-
 contrib/bc/src/main.c                              |   13 +-
 contrib/bc/src/num.c                               | 1583 ++++--
 contrib/bc/src/opt.c                               |  129 +-
 contrib/bc/src/parse.c                             |   83 +-
 contrib/bc/src/program.c                           | 1925 +++++--
 contrib/bc/src/rand.c                              |  185 +-
 contrib/bc/src/read.c                              |   87 +-
 contrib/bc/src/vector.c                            |  302 +-
 contrib/bc/src/vm.c                                |  695 ++-
 contrib/bc/tests/all.sh                            |   26 +-
 contrib/bc/tests/bc/all.txt                        |    9 +-
 contrib/bc/tests/bc/bitfuncs.txt                   | 5400 ++++++++++++++++++++
 contrib/bc/tests/bc/bitfuncs_results.txt           | 5400 ++++++++++++++++++++
 contrib/bc/tests/bc/decimal.txt                    |    4 +
 contrib/bc/tests/bc/decimal_results.txt            |    9 +-
 contrib/bc/tests/bc/divmod.txt                     |   64 +
 contrib/bc/tests/bc/divmod_results.txt             |  126 +
 contrib/bc/tests/bc/errors.txt                     |   48 +-
 contrib/bc/tests/bc/errors/25.txt                  |    4 +
 contrib/bc/tests/bc/errors/26.txt                  |  Bin 0 -> 317 bytes
 contrib/bc/tests/bc/errors/27.txt                  |    1 +
 contrib/bc/tests/bc/errors/28.txt                  |    2 +
 contrib/bc/tests/bc/errors/29.txt                  |   20 +
 contrib/bc/tests/bc/errors/30.txt                  |    3 +
 contrib/bc/tests/bc/errors/31.txt                  |    3 +
 contrib/bc/tests/bc/errors/32.txt                  |  Bin 0 -> 1701 bytes
 contrib/bc/tests/bc/lib2.txt                       |    7 +
 contrib/bc/tests/bc/lib2_results.txt               |    7 +
 contrib/bc/tests/bc/modexp.txt                     |  103 +
 contrib/bc/tests/bc/modexp_results.txt             |  103 +
 contrib/bc/tests/bc/pi_results.txt                 |    3 +-
 contrib/bc/tests/bc/posix_errors.txt               |    1 +
 contrib/bc/tests/bc/power.txt                      |   43 +
 contrib/bc/tests/bc/power_results.txt              |   72 +
 contrib/bc/tests/bc/recursive_arrays.txt           |  353 ++
 contrib/bc/tests/bc/recursive_arrays_results.txt   |    1 +
 contrib/bc/tests/bc/scripts/add.bc                 |    2 +-
 contrib/bc/tests/bc/scripts/all.txt                |    9 +-
 contrib/bc/tests/bc/scripts/array.bc               |    0
 contrib/bc/tests/bc/scripts/atan.bc                |    0
 contrib/bc/tests/bc/scripts/bessel.bc              |    0
 contrib/bc/tests/bc/scripts/divide.bc              |    1 +
 contrib/bc/tests/bc/scripts/globals.bc             |    0
 contrib/bc/tests/bc/scripts/multiply.bc            |    1 +
 contrib/bc/tests/bc/scripts/parse.bc               |    0
 contrib/bc/tests/bc/scripts/print.bc               |    0
 contrib/bc/tests/bc/scripts/references.bc          |    0
 contrib/bc/tests/bc/scripts/screen.bc              |    0
 contrib/bc/tests/bc/scripts/strings2.bc            |    7 +
 contrib/bc/tests/bc/scripts/subtract.bc            |    2 +-
 contrib/bc/tests/bc/strings.txt                    |   61 +
 contrib/bc/tests/bc/strings_results.txt            |   45 +
 contrib/bc/tests/bc/timeconst.sh                   |   22 +-
 contrib/bc/tests/bc/vars_results.txt               |    3 +-
 contrib/bc/tests/bcl.c                             |   56 +-
 contrib/bc/tests/dc/all.txt                        |    2 +
 contrib/bc/tests/dc/decimal.txt                    |    5 +
 contrib/bc/tests/dc/decimal_results.txt            |   11 +-
 contrib/bc/tests/dc/errors.txt                     |    4 +
 .../{fuzzing/dc_inputs/17.txt => dc/errors/32.txt} |    2 +-
 contrib/bc/tests/dc/errors/33.txt                  |  Bin 0 -> 329 bytes
 .../{fuzzing/dc_inputs/26.txt => dc/errors/34.txt} |  104 +-
 contrib/bc/tests/dc/exec_stack_len.txt             |    6 +
 contrib/bc/tests/dc/exec_stack_len_results.txt     |    8 +
 contrib/bc/tests/dc/length.txt                     |    2 +
 contrib/bc/tests/dc/length_results.txt             |    2 +
 contrib/bc/tests/dc/scientific.txt                 |    4 +
 contrib/bc/tests/dc/scientific_results.txt         |    4 +
 contrib/bc/tests/dc/scripts/array.dc               |    0
 contrib/bc/tests/dc/scripts/asciify.dc             |    0
 contrib/bc/tests/dc/scripts/easter.sh              |    4 +-
 contrib/bc/tests/dc/scripts/else.dc                |    0
 contrib/bc/tests/dc/scripts/factorial.dc           |    0
 contrib/bc/tests/dc/scripts/loop.dc                |    0
 contrib/bc/tests/dc/scripts/prime.dc               |    0
 contrib/bc/tests/dc/scripts/quit.dc                |    0
 contrib/bc/tests/dc/scripts/stream.dc              |    2 +-
 contrib/bc/tests/dc/scripts/stream.txt             |  Bin 0 -> 130834 bytes
 contrib/bc/tests/dc/scripts/weird.dc               |    0
 contrib/bc/tests/dc/stack_len.txt                  |   15 +
 contrib/bc/tests/dc/stack_len_results.txt          |   10 +
 contrib/bc/tests/dc/strings.txt                    |    1 +
 contrib/bc/tests/dc/strings_results.txt            |    1 +
 contrib/bc/tests/errors.sh                         |   54 +-
 contrib/bc/tests/extra_required.txt                |    1 +
 contrib/bc/tests/fuzzing/bc_afl.yaml               |  125 +
 contrib/bc/tests/fuzzing/bc_afl_continue.yaml      |  122 +
 contrib/bc/tests/fuzzing/bc_inputs1/abs.txt        |    7 -
 contrib/bc/tests/fuzzing/bc_inputs1/add.txt        |  146 -
 contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt |   26 -
 contrib/bc/tests/fuzzing/bc_inputs1/array.bc       |   60 -
 contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt     |   10 -
 .../bc/tests/fuzzing/bc_inputs1/assignments.txt    |  122 -
 contrib/bc/tests/fuzzing/bc_inputs1/basic.txt      |    7 -
 contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt    |  184 -
 contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt     |   44 -
 contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt    |   35 -
 contrib/bc/tests/fuzzing/bc_inputs1/divide.txt     |   31 -
 .../bc/tests/fuzzing/bc_inputs1/engineering.txt    |   19 -
 contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt   |   22 -
 contrib/bc/tests/fuzzing/bc_inputs1/functions.bc   |    7 -
 contrib/bc/tests/fuzzing/bc_inputs1/functions.txt  |   13 -
 contrib/bc/tests/fuzzing/bc_inputs1/globals.txt    |   21 -
 contrib/bc/tests/fuzzing/bc_inputs1/len.bc         |   48 -
 contrib/bc/tests/fuzzing/bc_inputs1/length.txt     |   59 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt      |    4 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt      |    4 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt       |   15 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt       |    6 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt       |   10 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt       |    2 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt       |    5 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt       |   12 -
 contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt       |    3 -
 contrib/bc/tests/fuzzing/bc_inputs1/strings.txt    |   14 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt      |    1 -
 contrib/bc/tests/fuzzing/bc_inputs2/log.txt        |   22 -
 contrib/bc/tests/fuzzing/bc_inputs2/misc.txt       |   13 -
 contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt      |   76 -
 contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt      |  110 -
 contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt      |   12 -
 contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt    |   69 -
 contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt   |   40 -
 contrib/bc/tests/fuzzing/bc_inputs2/pi.txt         |    4 -
 contrib/bc/tests/fuzzing/bc_inputs2/places.txt     |   19 -
 contrib/bc/tests/fuzzing/bc_inputs2/power.txt      |   44 -
 contrib/bc/tests/fuzzing/bc_inputs2/print2.txt     |  194 -
 contrib/bc/tests/fuzzing/bc_inputs2/references.bc  |  408 --
 contrib/bc/tests/fuzzing/bc_inputs2/scale.txt      |   57 -
 contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt |   51 -
 contrib/bc/tests/fuzzing/bc_inputs2/shift.txt      |  281 -
 contrib/bc/tests/fuzzing/bc_inputs2/sine.txt       |  207 -
 contrib/bc/tests/fuzzing/bc_inputs3/01.txt         |  339 --
 contrib/bc/tests/fuzzing/bc_inputs3/02.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/03.txt         |    2 -
 contrib/bc/tests/fuzzing/bc_inputs3/04.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/05.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/06.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/07.txt         |    8 -
 contrib/bc/tests/fuzzing/bc_inputs3/08.txt         |    3 -
 contrib/bc/tests/fuzzing/bc_inputs3/09.txt         |   11 -
 contrib/bc/tests/fuzzing/bc_inputs3/10.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/11.txt         |   99 -
 contrib/bc/tests/fuzzing/bc_inputs3/12.txt         |    2 -
 contrib/bc/tests/fuzzing/bc_inputs3/13.txt         |   56 -
 contrib/bc/tests/fuzzing/bc_inputs3/14.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/15.txt         |    3 -
 contrib/bc/tests/fuzzing/bc_inputs3/16.txt         |    1 -
 contrib/bc/tests/fuzzing/bc_inputs3/17.txt         |   11 -
 contrib/bc/tests/fuzzing/bc_inputs3/18.txt         |    3 -
 contrib/bc/tests/fuzzing/bc_inputs3/19.txt         |    5 -
 contrib/bc/tests/fuzzing/bc_inputs3/20.txt         |   51 -
 contrib/bc/tests/fuzzing/bc_inputs3/21.txt         |   10 -
 contrib/bc/tests/fuzzing/bc_inputs3/22.txt         |    2 -
 contrib/bc/tests/fuzzing/bc_inputs3/23.txt         |  Bin 1024 -> 0 bytes
 contrib/bc/tests/fuzzing/bc_inputs3/24.txt         |    4 -
 contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt       |   14 -
 contrib/bc/tests/fuzzing/bc_inputs3/strings.txt    |   12 -
 contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt   |  153 -
 contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt      |   15 -
 contrib/bc/tests/fuzzing/bc_inputs3/void.txt       |   20 -
 contrib/bc/tests/fuzzing/dc_inputs/01.txt          |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/02.txt          |    5 -
 contrib/bc/tests/fuzzing/dc_inputs/03.txt          |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/04.txt          |    9 -
 contrib/bc/tests/fuzzing/dc_inputs/05.txt          |    3 -
 contrib/bc/tests/fuzzing/dc_inputs/06.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/07.txt          |    3 -
 contrib/bc/tests/fuzzing/dc_inputs/08.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/09.txt          |    9 -
 contrib/bc/tests/fuzzing/dc_inputs/10.txt          |   11 -
 contrib/bc/tests/fuzzing/dc_inputs/11.txt          |    4 -
 contrib/bc/tests/fuzzing/dc_inputs/12.txt          |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/13.txt          |    7 -
 contrib/bc/tests/fuzzing/dc_inputs/14.txt          |    7 -
 contrib/bc/tests/fuzzing/dc_inputs/15.txt          |   11 -
 contrib/bc/tests/fuzzing/dc_inputs/16.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/18.txt          |    3 -
 contrib/bc/tests/fuzzing/dc_inputs/19.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/20.txt          |    3 -
 contrib/bc/tests/fuzzing/dc_inputs/21.txt          |    5 -
 contrib/bc/tests/fuzzing/dc_inputs/22.txt          |   36 -
 contrib/bc/tests/fuzzing/dc_inputs/23.txt          |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/24.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/25.txt          |    6 -
 contrib/bc/tests/fuzzing/dc_inputs/27.txt          |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/28.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/29.txt          |   13 -
 contrib/bc/tests/fuzzing/dc_inputs/30.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/31.txt          |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/abs.txt         |    7 -
 contrib/bc/tests/fuzzing/dc_inputs/add.txt         |   33 -
 contrib/bc/tests/fuzzing/dc_inputs/array.dc        |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/boolean.txt     |   80 -
 contrib/bc/tests/fuzzing/dc_inputs/decimal.txt     |   36 -
 contrib/bc/tests/fuzzing/dc_inputs/divide.txt      |   33 -
 contrib/bc/tests/fuzzing/dc_inputs/divmod.txt      |   64 -
 contrib/bc/tests/fuzzing/dc_inputs/else.dc         |    4 -
 contrib/bc/tests/fuzzing/dc_inputs/engineering.txt |   19 -
 contrib/bc/tests/fuzzing/dc_inputs/loop.dc         |    3 -
 contrib/bc/tests/fuzzing/dc_inputs/misc.txt        |    1 -
 contrib/bc/tests/fuzzing/dc_inputs/modexp.txt      |  103 -
 contrib/bc/tests/fuzzing/dc_inputs/modulus.txt     |   70 -
 contrib/bc/tests/fuzzing/dc_inputs/multiply.txt    |   42 -
 contrib/bc/tests/fuzzing/dc_inputs/places.txt      |   14 -
 contrib/bc/tests/fuzzing/dc_inputs/power.txt       |   36 -
 contrib/bc/tests/fuzzing/dc_inputs/quit.dc         |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/scientific.txt  |   51 -
 contrib/bc/tests/fuzzing/dc_inputs/shift.txt       |   42 -
 contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt        |   14 -
 contrib/bc/tests/fuzzing/dc_inputs/stack_len.txt   |    1 +
 contrib/bc/tests/fuzzing/dc_inputs/stdin.txt       |  205 -
 contrib/bc/tests/fuzzing/dc_inputs/stream.dc       |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/strings.txt     |   50 -
 contrib/bc/tests/fuzzing/dc_inputs/subtract.txt    |   33 -
 contrib/bc/tests/fuzzing/dc_inputs/trunc.txt       |   11 -
 contrib/bc/tests/fuzzing/dc_inputs/vars.txt        |    2 -
 contrib/bc/tests/fuzzing/dc_inputs/weird.dc        |    2 -
 contrib/bc/tests/history.py                        | 1087 ++++
 contrib/bc/tests/history.sh                        |   92 +
 contrib/bc/tests/other.sh                          |   90 +-
 contrib/bc/tests/read.sh                           |   21 +-
 contrib/bc/tests/script.sed                        |    9 +
 contrib/bc/tests/script.sh                         |   18 +-
 contrib/bc/tests/scripts.sh                        |    2 +
 contrib/bc/tests/stdin.sh                          |   15 +-
 contrib/bc/tests/test.sh                           |   13 +-
 usr.bin/gh-bc/Makefile                             |   20 +-
 usr.bin/gh-bc/tests/Makefile                       |    4 +-
 429 files changed, 54578 insertions(+), 73081 deletions(-)

diff --git a/contrib/bc/.gitattributes b/contrib/bc/.gitattributes
index 22d6e60bce68..1e2c56dde215 100644
--- a/contrib/bc/.gitattributes
+++ b/contrib/bc/.gitattributes
@@ -1,3 +1,3 @@
 *.vcxproj eol=crlf
 *.vcxproj.filters eol=crlf
-*.sln eol= crlf
+*.sln eol=crlf
diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore
index b131d5813764..31e43aa61efc 100644
--- a/contrib/bc/.gitignore
+++ b/contrib/bc/.gitignore
@@ -51,11 +51,17 @@ print_results.txt
 bessel.txt
 bessel_results.txt
 prime.txt
-stream.txt
+strings2.txt
+strings2_results.txt
 tests/bc/scripts/add.txt
 tests/bc/scripts/divide.txt
 tests/bc/scripts/multiply.txt
 tests/bc/scripts/subtract.txt
+tests/bc/scripts/strings2.txt
+benchmarks/bc/*.txt
+benchmarks/dc/*.txt
+scripts/ministat
+scripts/bitgen
 perf.data
 perf.data.old
 *.gcda
diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md
index 269e131cc81d..8ab2e6069881 100644
--- a/contrib/bc/LICENSE.md
+++ b/contrib/bc/LICENSE.md
@@ -79,9 +79,9 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-## `safe-install.sh`
+## `scripts/safe-install.sh`
 
-The file `safe-install.sh` is under the following copyright and license:
+The file `scripts/safe-install.sh` is under the following copyright and license:
 
 Copyright (c) 2021 Rich Felker
 
@@ -101,3 +101,13 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+## `scripts/ministat.c`
+
+The file `scripts/ministat.c` is under the following license:
+
+"THE BEER-WARE LICENSE" (Revision 42):
+
+<phk at FreeBSD.ORG> wrote this file. As long as you retain this notice you
+can do whatever you want with this stuff. If we meet some day, and you think
+this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in
index 2b50476a79fe..c3a41854fe9e 100644
--- a/contrib/bc/Makefile.in
+++ b/contrib/bc/Makefile.in
@@ -134,39 +134,64 @@ BC_ENABLE_HISTORY = %%HISTORY%%
 BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH
 BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%%
 BC_ENABLE_NLS = %%NLS%%
-BC_ENABLE_PROMPT = %%PROMPT%%
 BC_LONG_BIT = %%LONG_BIT%%
 
 BC_ENABLE_AFL = %%FUZZ%%
 BC_ENABLE_MEMCHECK = %%MEMCHECK%%
 
+BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%%
+BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%%
+DC_DEFAULT_SIGINT_RESET = %%DC_DEFAULT_SIGINT_RESET%%
+BC_DEFAULT_TTY_MODE = %%BC_DEFAULT_TTY_MODE%%
+DC_DEFAULT_TTY_MODE = %%DC_DEFAULT_TTY_MODE%%
+BC_DEFAULT_PROMPT = %%BC_DEFAULT_PROMPT%%
+DC_DEFAULT_PROMPT = %%DC_DEFAULT_PROMPT%%
+
 RM = rm
 MKDIR = mkdir
 
-INSTALL = ./exec-install.sh
-SAFE_INSTALL = ./safe-install.sh
-LINK = ./link.sh
-MANPAGE = ./manpage.sh
-KARATSUBA = ./karatsuba.py
-LOCALE_INSTALL = ./locale_install.sh
-LOCALE_UNINSTALL = ./locale_uninstall.sh
+SCRIPTS = ./scripts
+
+MINISTAT = ministat
+MINISTAT_EXEC = $(SCRIPTS)/$(MINISTAT)
+
+BITFUNCGEN = bitfuncgen
+BITFUNCGEN_EXEC = $(SCRIPTS)/$(BITFUNCGEN)
+
+INSTALL = $(SCRIPTS)/exec-install.sh
+SAFE_INSTALL = $(SCRIPTS)/safe-install.sh
+LINK = $(SCRIPTS)/link.sh
+MANPAGE = $(SCRIPTS)/manpage.sh
+KARATSUBA = $(SCRIPTS)/karatsuba.py
+LOCALE_INSTALL = $(SCRIPTS)/locale_install.sh
+LOCALE_UNINSTALL = $(SCRIPTS)/locale_uninstall.sh
 
 VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
 
-TEST_STARS = "***********************************************************************"
+TEST_STARS = ***********************************************************************
 
 BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%%
 
+BC_DEFS0 = -DBC_DEFAULT_BANNER=$(BC_DEFAULT_BANNER)
+BC_DEFS1 = -DBC_DEFAULT_SIGINT_RESET=$(BC_DEFAULT_SIGINT_RESET)
+BC_DEFS2 = -DBC_DEFAULT_TTY_MODE=$(BC_DEFAULT_TTY_MODE)
+BC_DEFS3 = -DBC_DEFAULT_PROMPT=$(BC_DEFAULT_PROMPT)
+BC_DEFS = $(BC_DEFS0) $(BC_DEFS1) $(BC_DEFS2) $(BC_DEFS3)
+DC_DEFS1 = -DDC_DEFAULT_SIGINT_RESET=$(DC_DEFAULT_SIGINT_RESET)
+DC_DEFS2 = -DDC_DEFAULT_TTY_MODE=$(DC_DEFAULT_TTY_MODE)
+DC_DEFS3 = -DDC_DEFAULT_PROMPT=$(DC_DEFAULT_PROMPT)
+DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3)
+
 CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED)
 CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%%
 CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC)
-CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
+CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 %%BSD%%
 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN)
-CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT)
+CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS)
 CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH)
 CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY)
 CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL)
-CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%%
+CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%%
 LDFLAGS = %%LDFLAGS%%
 
 HOSTCFLAGS = %%HOSTCFLAGS%%
@@ -219,6 +244,12 @@ $(BIN):
 
 headers: %%HEADERS%%
 
+$(MINISTAT):
+	$(HOSTCC) $(HOSTCFLAGS) -lm -o $(MINISTAT_EXEC) scripts/ministat.c
+
+$(BITFUNCGEN):
+	$(HOSTCC) $(HOSTCFLAGS) -lm -o $(BITFUNCGEN_EXEC) scripts/bitfuncgen.c
+
 help:
 	@printf 'available targets:\n'
 	@printf '\n'
@@ -249,16 +280,25 @@ help:
 	@printf '    valgrind_dc     runs the dc test suite, if dc has been built,\n'
 	@printf '                    through valgrind\n'
 
-run_all_tests:
+run_all_tests: bc_all_tests timeconst_all_tests dc_all_tests history_all_tests
+
+bc_all_tests:
 	%%BC_ALL_TESTS%%
+
+timeconst_all_tests:
 	%%TIMECONST_ALL_TESTS%%
+
+dc_all_tests:
 	%%DC_ALL_TESTS%%
 
+history_all_tests:
+	%%HISTORY_TESTS%%
+
 check: test
 
 test: %%TESTS%%
 
-test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other
+test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_errors test_bc_stdin test_bc_read test_bc_other
 	@printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n'
 
 test_bc_tests:%%BC_TESTS%%
@@ -275,12 +315,12 @@ test_bc_errors:
 	@sh tests/errors.sh bc %%BC_TEST_EXEC%%
 
 test_bc_other:
-	@sh tests/other.sh bc %%BC_TEST_EXEC%%
+	@sh tests/other.sh bc $(BC_ENABLE_EXTRA_MATH) %%BC_TEST_EXEC%%
 
 test_bc_header:
 	@printf '$(TEST_STARS)\n\nRunning bc tests...\n\n'
 
-test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_stdin test_dc_read test_dc_errors test_dc_other
+test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_errors test_dc_stdin test_dc_read test_dc_other
 	@printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n'
 
 test_dc_tests:%%DC_TESTS%%
@@ -297,7 +337,7 @@ test_dc_errors:
 	@sh tests/errors.sh dc %%DC_TEST_EXEC%%
 
 test_dc_other:
-	@sh tests/other.sh dc %%DC_TEST_EXEC%%
+	@sh tests/other.sh dc $(BC_ENABLE_EXTRA_MATH) %%DC_TEST_EXEC%%
 
 test_dc_header:
 	@printf '$(TEST_STARS)\n\nRunning dc tests...\n\n'
@@ -305,6 +345,122 @@ test_dc_header:
 timeconst:
 	%%TIMECONST%%
 
+test_history: test_history_header test_bc_history test_dc_history
+	@printf '\nAll history tests passed.\n\n$(TEST_STARS)\n'
+
+test_bc_history:%%BC_HISTORY_TEST_PREREQS%%
+
+test_bc_history_all: test_bc_history0 test_bc_history1 test_bc_history2 test_bc_history3 test_bc_history4 test_bc_history5 test_bc_history6 test_bc_history7 test_bc_history8 test_bc_history9 test_bc_history10 test_bc_history11 test_bc_history12 test_bc_history13 test_bc_history14 test_bc_history15 test_bc_history16 test_bc_history17 test_bc_history18 test_bc_history19 test_bc_history20 test_bc_history21
+
+test_bc_history_skip:
+	@printf 'No bc history tests to run\n'
+
+test_bc_history0:
+	@sh tests/history.sh bc 0 %%BC_TEST_EXEC%%
+
+test_bc_history1:
+	@sh tests/history.sh bc 1 %%BC_TEST_EXEC%%
+
+test_bc_history2:
+	@sh tests/history.sh bc 2 %%BC_TEST_EXEC%%
+
+test_bc_history3:
+	@sh tests/history.sh bc 3 %%BC_TEST_EXEC%%
+
+test_bc_history4:
+	@sh tests/history.sh bc 4 %%BC_TEST_EXEC%%
+
+test_bc_history5:
+	@sh tests/history.sh bc 5 %%BC_TEST_EXEC%%
+
+test_bc_history6:
+	@sh tests/history.sh bc 6 %%BC_TEST_EXEC%%
+
+test_bc_history7:
+	@sh tests/history.sh bc 7 %%BC_TEST_EXEC%%
+
+test_bc_history8:
+	@sh tests/history.sh bc 8 %%BC_TEST_EXEC%%
+
+test_bc_history9:
+	@sh tests/history.sh bc 9 %%BC_TEST_EXEC%%
+
+test_bc_history10:
+	@sh tests/history.sh bc 10 %%BC_TEST_EXEC%%
+
+test_bc_history11:
+	@sh tests/history.sh bc 11 %%BC_TEST_EXEC%%
+
+test_bc_history12:
+	@sh tests/history.sh bc 12 %%BC_TEST_EXEC%%
+
+test_bc_history13:
+	@sh tests/history.sh bc 13 %%BC_TEST_EXEC%%
+
+test_bc_history14:
+	@sh tests/history.sh bc 14 %%BC_TEST_EXEC%%
+
+test_bc_history15:
+	@sh tests/history.sh bc 15 %%BC_TEST_EXEC%%
+
+test_bc_history16:
+	@sh tests/history.sh bc 16 %%BC_TEST_EXEC%%
+
+test_bc_history17:
+	@sh tests/history.sh bc 17 %%BC_TEST_EXEC%%
+
+test_bc_history18:
+	@sh tests/history.sh bc 18 %%BC_TEST_EXEC%%
+
+test_bc_history19:
+	@sh tests/history.sh bc 19 %%BC_TEST_EXEC%%
+
+test_bc_history20:
+	@sh tests/history.sh bc 20 %%BC_TEST_EXEC%%
+
+test_bc_history21:
+	@sh tests/history.sh bc 21 %%BC_TEST_EXEC%%
+
+test_dc_history:%%DC_HISTORY_TEST_PREREQS%%
+
+test_dc_history_all: test_dc_history0 test_dc_history1 test_dc_history2 test_dc_history3 test_dc_history4 test_dc_history5 test_dc_history6 test_dc_history7 test_dc_history8 test_dc_history9
+
+test_dc_history_skip:
+	@printf 'No dc history tests to run\n'
+
+test_dc_history0:
+	@sh tests/history.sh dc 0 %%DC_TEST_EXEC%%
+
+test_dc_history1:
+	@sh tests/history.sh dc 1 %%DC_TEST_EXEC%%
+
+test_dc_history2:
+	@sh tests/history.sh dc 2 %%DC_TEST_EXEC%%
+
+test_dc_history3:
+	@sh tests/history.sh dc 3 %%DC_TEST_EXEC%%
+
+test_dc_history4:
+	@sh tests/history.sh dc 4 %%DC_TEST_EXEC%%
+
+test_dc_history5:
+	@sh tests/history.sh dc 5 %%DC_TEST_EXEC%%
+
+test_dc_history6:
+	@sh tests/history.sh dc 6 %%DC_TEST_EXEC%%
+
+test_dc_history7:
+	@sh tests/history.sh dc 7 %%DC_TEST_EXEC%%
+
+test_dc_history8:
+	@sh tests/history.sh dc 8 %%DC_TEST_EXEC%%
+
+test_dc_history9:
+	@sh tests/history.sh dc 9 %%DC_TEST_EXEC%%
+
+test_history_header:
+	@printf '$(TEST_STARS)\n\nRunning history tests...\n\n'
+
 library_test: $(LIBBC)
 	$(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST)
 
@@ -322,12 +478,6 @@ coverage_output:
 
 coverage:%%COVERAGE_PREREQS%%
 
-libcname:
-	@printf '%s' "$(BC_LIB_C)"
-
-extra_math:
-	@printf '%s' "$(BC_ENABLE_EXTRA_MATH)"
-
 manpages:
 	$(MANPAGE) bc
 	$(MANPAGE) dc
@@ -348,15 +498,19 @@ clean:%%CLEAN_PREREQS%%
 	@$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O)
 	@$(RM) -f $(BC_HELP_C) $(BC_HELP_O)
 	@$(RM) -f $(DC_HELP_C) $(DC_HELP_O)
-	@$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS)
-	@$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS)
 	@$(RM) -fr Debug/ Release/
 
-clean_config: clean
+clean_benchmarks:
+	@printf 'Cleaning benchmarks...\n'
+	@$(RM) -f $(MINISTAT_EXEC)
+	@$(RM) -f benchmarks/bc/*.txt
+	@$(RM) -f benchmarks/dc/*.txt
+
+clean_config: clean clean_benchmarks
 	@printf 'Cleaning config...\n'
 	@$(RM) -f Makefile
-	@$(RM) -f $(BC_MD) $(DC_MD)
-	@$(RM) -f $(BC_MANPAGE) $(DC_MANPAGE)
+	@$(RM) -f $(BC_MD) $(BC_MANPAGE)
+	@$(RM) -f $(DC_MD) $(DC_MANPAGE)
 
 clean_coverage:
 	@printf 'Cleaning coverage files...\n'
@@ -376,9 +530,12 @@ clean_coverage:
 
 clean_tests: clean clean_config clean_coverage
 	@printf 'Cleaning test files...\n'
+	@$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS)
+	@$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS)
 	@$(RM) -f tests/bc/parse.txt tests/bc/parse_results.txt
 	@$(RM) -f tests/bc/print.txt tests/bc/print_results.txt
 	@$(RM) -f tests/bc/bessel.txt tests/bc/bessel_results.txt
+	@$(RM) -f tests/bc/strings2.txt tests/bc/strings2_results.txt
 	@$(RM) -f tests/bc/scripts/bessel.txt
 	@$(RM) -f tests/bc/scripts/parse.txt
 	@$(RM) -f tests/bc/scripts/print.txt
@@ -386,13 +543,15 @@ clean_tests: clean clean_config clean_coverage
 	@$(RM) -f tests/bc/scripts/divide.txt
 	@$(RM) -f tests/bc/scripts/multiply.txt
 	@$(RM) -f tests/bc/scripts/subtract.txt
-	@$(RM) -f tests/dc/scripts/prime.txt tests/dc/scripts/stream.txt
+	@$(RM) -f tests/bc/scripts/strings2.txt
+	@$(RM) -f tests/dc/scripts/prime.txt
 	@$(RM) -f .log_*.txt
 	@$(RM) -f .math.txt .results.txt .ops.txt
 	@$(RM) -f .test.txt
 	@$(RM) -f tags .gdbbreakpoints .gdb_history .gdbsetup
 	@$(RM) -f cscope.*
 	@$(RM) -f bc.old
+	@$(RM) -f $(BITFUNCGEN_EXEC)
 
 install_locales:
 	%%INSTALL_LOCALES%%
diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md
index c78bddd27e76..3b1477cafb26 100644
--- a/contrib/bc/NEWS.md
+++ b/contrib/bc/NEWS.md
@@ -1,5 +1,55 @@
 # News
 
+## 5.0.0
+
+This is a major production release with several changes:
+
+* Added support for OpenBSD's `pledge()` and `unveil()`.
+* Fixed print bug where a backslash newline combo was printed even if only one
+  digit was left, something I blindly copied from GNU `bc`, like a fool.
+* Fixed bugs in the manuals.
+* Fixed a possible multiplication overflow in power.
+* Temporary numbers are garbage collected if allocation fails, and the
+  allocation is retried. This is to make `bc` and `dc` more resilient to running
+  out of memory.
+* Limited the number of temporary numbers and made the space for them static so
+  that allocating more space for them cannot fail.
+* Allowed integers with non-zero `scale` to be used with power, places, and
+  shift operators.
+* Added greatest common divisor and least common multiple to `lib2.bc`.
+* Added `SIGQUIT` handling to history.
+* Added a command to `dc` (`y`) to get the length of register stacks.
+* Fixed multi-digit bugs in `lib2.bc`.
+* Removed the no prompt build option.
+* Created settings that builders can set defaults for and users can set their
+  preferences for. This includes the `bc` banner, resetting on `SIGINT`, TTY
+  mode, and prompt.
+* Added history support to Windows.
+* Fixed bugs with the handling of register names in `dc`.
+* Fixed bugs with multi-line comments and strings in both calculators.
+* Added a new error type and message for `dc` when register stacks don't have
+  enough items.
+* Optimized string allocation.
+* Made `bc` and `dc` UTF-8 capable.
+* Fixed a bug with `void` functions.
+* Fixed a misspelled symbol in `bcl`. This is technically a breaking change,
+  which requires this to be `5.0.0`.
+* Added the ability for users to get the copyright banner back.
+* Added the ability for users to have `bc` and `dc` quit on `SIGINT`.
+* Added the ability for users to disable prompt and TTY mode by environment
+  variables.
+* Added the ability for users to redefine keywords. This is another reason this
+  is `5.0.0`.
+* Added `dc`'s modular exponentiation and divmod to `bc`.
+* Added the ability to assign strings to variables and array elements and pass
+  them to functions in `bc`.
+* Added `dc`'s asciify command and stream printing to `bc`.
+* Added a command to `dc` (`Y`) to get the length of an array.
+* Added a command to `dc` (`,`) to get the depth of the execution stack.
+* Added bitwise and, or, xor, left shift, right shift, reverse, left rotate,
+  right rotate, and mod functions to `lib2.bc`.
+* Added the functions `s2u(x)` and `s2un(x,n)`, to `lib2.bc`.
+
 ## 4.0.2
 
 This is a production release that fixes two bugs:
@@ -310,8 +360,8 @@ running tests during install. **If `bc` segfaults while running arg tests when
 updating, it is because the global locale files have not been replaced. Make
 sure to either prevent the test suite from running on update or remove the old
 locale files before updating.** (Removing the locale files can be done with
-`make uninstall` or by running the `locale_uninstall.sh` script.) Once this is
-done, `bc` should install without problems.*
+`make uninstall` or by running the [`locale_uninstall.sh`][22] script.) Once
+this is done, `bc` should install without problems.*
 
 *Second, **the option to build without signal support has been removed**. See
 below for the reasons why.*
@@ -396,7 +446,7 @@ diameter of the universe in Planck lengths.
 
 (For 32-bit, these numbers are either 32 integer digits or 12 integer digits and
 20 fractional digits. These are also quite big, and going much bigger on a
-32-bit system seems a little pointless since 12 digits in just under a trillion
+32-bit system seems a little pointless since 12 digits is just under a trillion
 and 20 fractional digits is still enough for about any use since `10^-20` light
 years is just under a millimeter.)
 
@@ -1084,7 +1134,7 @@ not thoroughly tested.
 [1]: https://docs.microsoft.com/en-us/windows/wsl/install-win10
 [2]: https://pkg.musl.cc/bc/
 [3]: http://lcamtuf.coredump.cx/afl/
-[4]: ./karatsuba.py
+[4]: ./scripts/karatsuba.py
 [5]: ./README.md
 [6]: ./configure.sh
 [7]: https://github.com/rain-1/linenoise-mob
@@ -1092,7 +1142,7 @@ not thoroughly tested.
 [9]: ./manuals/bc/A.1.md
 [10]: ./manuals/dc/A.1.md
 [11]: https://scan.coverity.com/projects/gavinhoward-bc
-[12]: ./locale_install.sh
+[12]: ./scripts/locale_install.sh
 [13]: ./manuals/build.md
 [14]: https://github.com/stesser
 [15]: https://github.com/bugcrazy
@@ -1102,3 +1152,4 @@ not thoroughly tested.
 [19]: ./manuals/benchmarks.md
 [20]: https://github.com/apjanke/ronn-ng
 [21]: https://pandoc.org/
+[22]: ./scripts/locale_uninstall.sh
diff --git a/contrib/bc/README.md b/contrib/bc/README.md
index f0dcecf15bde..c46d66b7e3ea 100644
--- a/contrib/bc/README.md
+++ b/contrib/bc/README.md
@@ -1,7 +1,5 @@
 # `bc`
 
-[![Coverity Scan Build Status][17]][18]
-
 ***WARNING: This project has moved to [https://git.yzena.com/][20] for [these
 reasons][21], though GitHub will remain a mirror.***
 
@@ -23,6 +21,8 @@ This `bc` also provides `bc`'s math as a library with C bindings, called `bcl`.
 
 For more information, see the full manual for `bcl`.
 
+## License
+
*** 154626 LINES SKIPPED ***


More information about the dev-commits-src-all mailing list