Merge commit '47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc'

Update to version 3.2.6

MFC after:	3 days
This commit is contained in:
Stefan Eßer 2021-01-31 21:07:42 +01:00
commit 10328f8b11
320 changed files with 6246 additions and 712 deletions

View File

@ -34,6 +34,13 @@ config.mak
timeconst.bc
Makefile
tests/fuzzing/bc_outputs1/*
tests/fuzzing/bc_outputs2/*
tests/fuzzing/bc_outputs3/*
tests/fuzzing/dc_outputs/*
tests/bc_outputs/*
tests/dc_outputs/*
.gdb_history
# Ignore the generated test files
@ -57,5 +64,7 @@ perf.data.old
*.html
*.profraw
core.*
cscope*.out
tags

View File

@ -1,6 +1,6 @@
# License
Copyright (c) 2018-2020 Gavin D. Howard <yzena.tech@gmail.com>
Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@ -31,7 +31,7 @@ copyrights and license:
Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com><br>
Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com><br>
Copyright (c) 2018 rain-1 <rain1@openmailbox.org><br>
Copyright (c) 2018-2020, Gavin D. Howard <yzena.tech@gmail.com>
Copyright (c) 2018-2021, Gavin D. Howard <yzena.tech@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@ -53,3 +53,51 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## Rand
The files `src/rand.c` and `include/rand.h` are under the following copyrights
and license:
Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
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.
## `safe-install.sh`
The file `safe-install.sh` is under the following copyright and license:
Copyright (c) 2021 Rich Felker
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
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.

View File

@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ -29,7 +29,7 @@
#
.POSIX:
VERSION = 3.2.4
VERSION = 3.2.6
SRC = %%SRC%%
OBJ = %%OBJ%%
@ -41,6 +41,13 @@ BC_ENABLED = %%BC_ENABLED%%
DC_ENABLED_NAME = DC_ENABLED
DC_ENABLED = %%DC_ENABLED%%
HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h
BC_HEADERS = include/bc.h
DC_HEADERS = include/dc.h
HISTORY_HEADERS = include/history.h
EXTRA_MATH_HEADERS = include/rand.h
LIBRARY_HEADERS = include/bcl.h include/library.h
GEN_DIR = gen
GEN = %%GEN%%
GEN_EXEC = $(GEN_DIR)/$(GEN)
@ -82,6 +89,11 @@ DC = dc
BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC)
DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC)
BC_TEST_OUTPUTS = tests/bc_outputs
BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3
DC_TEST_OUTPUTS = tests/dc_outputs
DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs
LIB = libbcl
LIB_NAME = $(LIB).a
LIBBC = $(BIN)/$(LIB_NAME)
@ -125,6 +137,9 @@ BC_ENABLE_NLS = %%NLS%%
BC_ENABLE_PROMPT = %%PROMPT%%
BC_LONG_BIT = %%LONG_BIT%%
BC_ENABLE_AFL = %%FUZZ%%
BC_ENABLE_MEMCHECK = %%MEMCHECK%%
RM = rm
MKDIR = mkdir
@ -138,6 +153,8 @@ LOCALE_UNINSTALL = ./locale_uninstall.sh
VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
TEST_STARS = "***********************************************************************"
BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%%
CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED)
@ -147,7 +164,8 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN)
CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT)
CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH)
CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY)
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%%
LDFLAGS = %%LDFLAGS%%
@ -159,20 +177,15 @@ HOSTCC = %%HOSTCC%%
BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1
BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1
OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
OBJS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
.c.o:
$(CC) $(CFLAGS) -o $@ -c $<
all: %%DEFAULT_TARGET%%
all: %%ALL_PREREQ%%
%%DEFAULT_TARGET%%: %%DEFAULT_TARGET_PREREQS%%
%%DEFAULT_TARGET_CMD%%
execs: make_bin $(OBJ_TARGETS)
$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC)
%%LINK%%
library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O)
ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%%
%%SECOND_TARGET_CMD%%
$(GEN_EXEC):
%%GEN_EXEC_TARGET%%
@ -180,18 +193,32 @@ $(GEN_EXEC):
$(BC_LIB_C): $(GEN_EXEC) $(BC_LIB)
$(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS)
$(BC_LIB_O): $(BC_LIB_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2)
$(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS)
$(BC_LIB2_O): $(BC_LIB2_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BC_HELP_C): $(GEN_EXEC) $(BC_HELP)
$(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME)
$(BC_HELP_O): $(BC_HELP_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(DC_HELP_C): $(GEN_EXEC) $(DC_HELP)
$(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME)
make_bin:
$(DC_HELP_O): $(DC_HELP_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BIN):
$(MKDIR) -p $(BIN)
headers: %%HEADERS%%
help:
@printf 'available targets:\n'
@printf '\n'
@ -222,41 +249,68 @@ help:
@printf ' valgrind_dc runs the dc test suite, if dc has been built,\n'
@printf ' through valgrind\n'
run_all_tests:
%%BC_ALL_TESTS%%
%%TIMECONST_ALL_TESTS%%
%%DC_ALL_TESTS%%
check: test
test: %%TESTS%%
test_bc:
%%BC_TEST%%
test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other
@printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n'
test_dc:
%%DC_TEST%%
test_bc_tests:%%BC_TESTS%%
time_test: time_test_bc timeconst time_test_dc
test_bc_scripts:%%BC_SCRIPT_TESTS%%
time_test_bc:
%%BC_TIME_TEST%%
test_bc_stdin:
@sh tests/stdin.sh bc %%BC_TEST_EXEC%%
time_test_dc:
%%DC_TIME_TEST%%
test_bc_read:
@sh tests/read.sh bc %%BC_TEST_EXEC%%
test_bc_errors:
@sh tests/errors.sh bc %%BC_TEST_EXEC%%
test_bc_other:
@sh tests/other.sh bc %%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
@printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n'
test_dc_tests:%%DC_TESTS%%
test_dc_scripts:%%DC_SCRIPT_TESTS%%
test_dc_stdin:
@sh tests/stdin.sh dc %%DC_TEST_EXEC%%
test_dc_read:
@sh tests/read.sh dc %%DC_TEST_EXEC%%
test_dc_errors:
@sh tests/errors.sh dc %%DC_TEST_EXEC%%
test_dc_other:
@sh tests/other.sh dc %%DC_TEST_EXEC%%
test_dc_header:
@printf '$(TEST_STARS)\n\nRunning dc tests...\n\n'
timeconst:
%%TIMECONST%%
library_test: library
library_test: $(LIBBC)
$(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST)
test_library: library_test
$(BCL_TEST)
valgrind: valgrind_bc valgrind_dc
valgrind_bc:
%%VG_BC_TEST%%
valgrind_dc:
%%VG_DC_TEST%%
karatsuba:
%%KARATSUBA%%
@ -296,6 +350,8 @@ 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)
clean_config: clean
@printf 'Cleaning config...\n'

View File

@ -1,5 +1,40 @@
# News
## 3.2.6
This is a production release that fixes the build on FreeBSD.
There was a syntax error in `configure.sh` that the Linux shell did not catch,
and FreeBSD depends on the existence of `tests/all.sh`.
All users that already upgraded to `3.2.5` should update to this release, with
my apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in
favor of this version.
## 3.2.5
This is a production release that fixes several bugs and adds a couple small
things.
The two most important bugs were bugs that causes `dc` to access memory
out-of-bounds (crash in debug builds). This was found by upgrading to `afl++`
from `afl`. Both were caused by a failure to distinguish between the same two
cases.
Another bug was the failure to put all of the licenses in the `LICENSE.md` file.
Third, some warnings by `scan-build` were found and eliminated. This needed one
big change: `bc` and `dc` now bail out as fast as possible on fatal errors
instead of unwinding the stack.
Fourth, the pseudo-random number now attempts to seed itself with `/dev/random`
if `/dev/urandom` fails.
Finally, this release has a few quality-of-life changes to the build system. The
usage should not change at all; the only thing that changed was making sure the
`Makefile.in` was written to rebuild properly when headers changed and to not
rebuild when not necessary.
## 3.2.4
This is a production release that fixes a warning on `gcc` 6 or older, which

View File

@ -1,6 +1,6 @@
# Notice
Copyright 2018-2020 Gavin D. Howard and contributors.
Copyright 2018-2021 Gavin D. Howard and contributors.
## Contributors

View File

@ -39,6 +39,7 @@ Systems that are known to work:
* Mac OSX
* Solaris* (as long as the Solaris version supports POSIX 2008)
* AIX
* HP-UX* (except for history)
Please submit bug reports if this `bc` does not build out of the box on any
system besides Windows. If Windows binaries are needed, they can be found at

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ -33,6 +33,8 @@ script=$(basename "$script")
. "$scriptdir/functions.sh"
cd "$scriptdir"
usage() {
if [ $# -gt 0 ]; then
@ -48,7 +50,7 @@ usage() {
printf 'usage:\n'
printf ' %s -h\n' "$script"
printf ' %s --help\n' "$script"
printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script"
printf ' %s [-a|-bD|-dB|-c] [-CEfgGHlmMNPtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script"
printf ' %s \\\n' "$script"
printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n'
printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n'
@ -73,6 +75,8 @@ usage() {
printf ' Generate test coverage code. Requires gcov and regcovr.\n'
printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n'
printf ' Requires a compiler that use gcc-compatible coverage options\n'
printf ' -C, --disable-clean\n'
printf ' Disable the clean that configure.sh does before configure.\n'
printf ' -d, --dc-only\n'
printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n'
printf ' "--disable-dc" are specified too.\n'
@ -107,6 +111,8 @@ usage() {
printf ' Installs all locales, regardless of how many are on the system. This\n'
printf ' option is useful for package maintainers who want to make sure that\n'
printf ' a package contains all of the locales that end users might need.\n'
printf ' -m, --enable-memcheck\n'
printf ' Enable memcheck mode, to ensure no memory leaks. For development only.\n'
printf ' -M, --disable-man-pages\n'
printf ' Disable installing manpages.\n'
printf ' -N, --disable-nls\n'
@ -119,9 +125,15 @@ usage() {
printf ' Disables the prompt in the built bc. The prompt will never show up,\n'
printf ' or in other words, it will be permanently disabled and cannot be\n'
printf ' enabled.\n'
printf ' -t, --enable-test-timing\n'
printf ' Enable the timing of tests. This is for development only.\n'
printf ' -T, --disable-strip\n'
printf ' Disable stripping symbols from the compiled binary or binaries.\n'
printf ' Stripping symbols only happens when debug mode is off.\n'
printf ' -v, --enable-valgrind\n'
printf ' Enable a build appropriate for valgrind. For development only.\n'
printf ' -z, --enable-fuzz-mode\n'
printf ' Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n'
printf ' --prefix PREFIX\n'
printf ' The prefix to install to. Overrides "$PREFIX" if it exists.\n'
printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n'
@ -277,6 +289,23 @@ replace() {
substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement"
}
find_src_files() {
if [ "$#" -ge 1 ] && [ "$1" != "" ]; then
while [ "$#" -ge 1 ]; do
_find_src_files_a="${1## }"
shift
_find_src_files_args="$_find_src_files_args ! -path src/${_find_src_files_a}"
done
else
_find_src_files_args="-print"
fi
printf '%s\n' $(find src/ -depth -name "*.c" $_find_src_files_args)
}
gen_file_list() {
if [ "$#" -lt 1 ]; then
@ -291,15 +320,9 @@ gen_file_list() {
cd "$scriptdir"
if [ "$#" -ge 1 ]; then
while [ "$#" -ge 1 ]; do
a="$1"
shift
args="$args ! -path src/${a}"
done
_gen_file_list_unneeded="$@"
else
args="-print"
_gen_file_list_unneeded=""
fi
_gen_file_list_needle_src="SRC"
@ -307,7 +330,7 @@ gen_file_list() {
_gen_file_list_needle_gcda="GCDA"
_gen_file_list_needle_gcno="GCNO"
_gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ')
_gen_file_list_replacement=$(find_src_files $_gen_file_list_unneeded | tr '\n' ' ')
_gen_file_list_contents=$(replace "$_gen_file_list_contents" \
"$_gen_file_list_needle_src" "$_gen_file_list_replacement")
@ -328,6 +351,101 @@ gen_file_list() {
printf '%s\n' "$_gen_file_list_contents"
}
gen_tests() {
_gen_tests_name="$1"
shift
_gen_tests_uname="$1"
shift
_gen_tests_extra_math="$1"
shift
_gen_tests_time_tests="$1"
shift
_gen_tests_extra_required=$(cat tests/extra_required.txt)
for _gen_tests_t in $(cat "$scriptdir/tests/$_gen_tests_name/all.txt"); do
if [ "$_gen_tests_extra_math" -eq 0 ]; then
if [ -z "${_gen_tests_extra_required##*$_gen_tests_t*}" ]; then
printf 'test_%s_%s:\n\t@printf "Skipping %s %s\\n"\n\n' \
"$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \
"$_gen_tests_t" >> "$scriptdir/Makefile"
continue
fi
fi
printf 'test_%s_%s:\n\t@sh tests/test.sh %s %s %s %s %s\n\n' \
"$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \
"$_gen_tests_t" "$generate_tests" "$time_tests" \
"$*" >> "$scriptdir/Makefile"
done
}
gen_test_targets() {
_gen_test_targets_name="$1"
shift
_gen_test_targets_tests=$(cat "$scriptdir/tests/${_gen_test_targets_name}/all.txt")
for _gen_test_targets_t in $_gen_test_targets_tests; do
printf ' test_%s_%s' "$_gen_test_targets_name" "$_gen_test_targets_t"
done
printf '\n'
}
gen_script_tests() {
_gen_script_tests_name="$1"
shift
_gen_script_tests_extra_math="$1"
shift
_gen_script_tests_generate="$1"
shift
_gen_script_tests_time="$1"
shift
_gen_script_tests_tests=$(cat "$scriptdir/tests/$_gen_script_tests_name/scripts/all.txt")
for _gen_script_tests_f in $_gen_script_tests_tests; do
_gen_script_tests_b=$(basename "$_gen_script_tests_f" ".${_gen_script_tests_name}")
printf 'test_%s_script_%s:\n\t@sh tests/script.sh %s %s %s 1 %s %s %s\n\n' \
"$_gen_script_tests_name" "$_gen_script_tests_b" "$_gen_script_tests_name" \
"$_gen_script_tests_f" "$_gen_script_tests_extra_math" "$_gen_script_tests_generate" \
"$_gen_script_tests_time" "$*" >> "$scriptdir/Makefile"
done
}
gen_script_test_targets() {
_gen_script_test_targets_name="$1"
shift
_gen_script_test_targets_tests=$(cat "$scriptdir/tests/$_gen_script_test_targets_name/scripts/all.txt")
for _gen_script_test_targets_f in $_gen_script_test_targets_tests; do
_gen_script_test_targets_b=$(basename "$_gen_script_test_targets_f" \
".$_gen_script_test_targets_name")
printf ' test_%s_script_%s' "$_gen_script_test_targets_name" \
"$_gen_script_test_targets_b"
done
printf '\n'
}
bc_only=0
dc_only=0
coverage=0
@ -344,14 +462,20 @@ force=0
strip_bin=1
all_locales=0
library=0
fuzz=0
time_tests=0
vg=0
memcheck=0
clean=1
while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do
while getopts "abBcdDEfgGhHk:lMmNO:PStTvz-" opt; do
case "$opt" in
a) library=1 ;;
b) bc_only=1 ;;
B) dc_only=1 ;;
c) coverage=1 ;;
C) clean=0 ;;
d) dc_only=1 ;;
D) bc_only=1 ;;
E) extra_math=0 ;;
@ -362,11 +486,15 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do
H) hist=0 ;;
k) karatsuba_len="$OPTARG" ;;
l) all_locales=1 ;;
m) memcheck=1 ;;
M) install_manpages=0 ;;
N) nls=0 ;;
O) optimization="$OPTARG" ;;
P) prompt=0 ;;
t) time_tests=1 ;;
T) strip_bin=0 ;;
v) vg=1 ;;
z) fuzz=1 ;;
-)
arg="$1"
arg="${arg#--}"
@ -465,6 +593,7 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do
shift ;;
disable-bc) dc_only=1 ;;
disable-dc) bc_only=1 ;;
disable-clean) clean=0 ;;
disable-extra-math) extra_math=0 ;;
disable-generated-tests) generate_tests=0 ;;
disable-history) hist=0 ;;
@ -472,16 +601,24 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do
disable-nls) nls=0 ;;
disable-prompt) prompt=0 ;;
disable-strip) strip_bin=0 ;;
enable-test-timing) time_tests=1 ;;
enable-valgrind) vg=1 ;;
enable-fuzz-mode) fuzz=1 ;;
enable-memcheck) memcheck=1 ;;
install-all-locales) all_locales=1 ;;
help* | bc-only* | dc-only* | coverage* | debug*)
usage "No arg allowed for --$arg option" ;;
disable-bc* | disable-dc* | disable-extra-math*)
disable-bc* | disable-dc* | disable-clean*)
usage "No arg allowed for --$arg option" ;;
disable-extra-math*)
usage "No arg allowed for --$arg option" ;;
disable-generated-tests* | disable-history*)
usage "No arg allowed for --$arg option" ;;
disable-man-pages* | disable-nls* | disable-strip*)
usage "No arg allowed for --$arg option" ;;
install-all-locales*)
enable-fuzz-mode* | enable-test-timing* | enable-valgrind*)
usage "No arg allowed for --$arg option" ;;
enable-memcheck* | install-all-locales*)
usage "No arg allowed for --$arg option" ;;
'') break ;; # "--" terminates argument processing
* ) usage "Invalid option $LONG_OPTARG" ;;
@ -493,6 +630,12 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do
done
if [ "$clean" -ne 0 ]; then
if [ -f ./Makefile ]; then
make clean_config > /dev/null
fi
fi
if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then
usage "Can only specify one of -b(-D) or -d(-B)"
fi
@ -581,21 +724,19 @@ executable="BC_EXEC"
tests="test_bc timeconst test_dc"
bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 \$(BC_EXEC)"
bc_time_test="@tests/all.sh bc $extra_math 1 $generate_tests 1 \$(BC_EXEC)"
dc_test="@tests/all.sh dc $extra_math 1 $generate_tests 0 \$(DC_EXEC)"
dc_time_test="@tests/all.sh dc $extra_math 1 $generate_tests 1 \$(DC_EXEC)"
timeconst="@tests/bc/timeconst.sh tests/bc/scripts/timeconst.bc \$(BC_EXEC)"
# In order to have cleanup at exit, we need to be in
# debug mode, so don't run valgrind without that.
if [ "$debug" -ne 0 ]; then
vg_bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 valgrind \$(VALGRIND_ARGS) \$(BC_EXEC)"
vg_dc_test="@tests/all.sh dc $extra_math 1 $generate_tests 0 valgrind \$(VALGRIND_ARGS) \$(DC_EXEC)"
if [ "$vg" -ne 0 ]; then
debug=1
bc_test_exec='valgrind $(VALGRIND_ARGS) $(BC_EXEC)'
dc_test_exec='valgrind $(VALGRIND_ARGS) $(DC_EXEC)'
else
vg_bc_test="@printf 'Cannot run valgrind without debug flags\\\\n'"
vg_dc_test="@printf 'Cannot run valgrind without debug flags\\\\n'"
bc_test_exec='$(BC_EXEC)'
dc_test_exec='$(DC_EXEC)'
fi
karatsuba="@printf 'karatsuba cannot be run because one of bc or dc is not built\\\\n'"
@ -605,7 +746,29 @@ bc_lib="\$(GEN_DIR)/lib.o"
bc_help="\$(GEN_DIR)/bc_help.o"
dc_help="\$(GEN_DIR)/dc_help.o"
if [ "$bc_only" -eq 1 ]; then
default_target_prereqs="\$(BIN) \$(OBJS)"
default_target_cmd="\$(CC) \$(CFLAGS) \$(OBJS) \$(LDFLAGS) -o \$(EXEC)"
default_target="\$(DC_EXEC)"
second_target_prereqs=""
second_target_cmd="$default_target_cmd"
second_target="\$(BC_EXEC)"
if [ "$library" -ne 0 ]; then
extra_math=1
nls=0
hist=0
prompt=0
bc=1
dc=1
default_target_prereqs="\$(BIN) \$(OBJ)"
default_target_cmd="ar -r -cu \$(LIBBC) \$(OBJ)"
default_target="\$(LIBBC)"
tests="test_library"
elif [ "$bc_only" -eq 1 ]; then
bc=1
dc=0
@ -615,14 +778,16 @@ if [ "$bc_only" -eq 1 ]; then
executables="bc"
dc_test="@printf 'No dc tests to run\\\\n'"
dc_time_test="@printf 'No dc tests to run\\\\n'"
vg_dc_test="@printf 'No dc tests to run\\\\n'"
install_prereqs=" install_execs"
install_man_prereqs=" install_bc_manpage"
uninstall_prereqs=" uninstall_bc"
uninstall_man_prereqs=" uninstall_bc_manpage"
default_target="\$(BC_EXEC)"
second_target="\$(DC_EXEC)"
tests="test_bc timeconst"
elif [ "$dc_only" -eq 1 ]; then
bc=0
@ -637,8 +802,6 @@ elif [ "$dc_only" -eq 1 ]; then
executable="DC_EXEC"
bc_test="@printf 'No bc tests to run\\\\n'"
bc_time_test="@printf 'No bc tests to run\\\\n'"
vg_bc_test="@printf 'No bc tests to run\\\\n'"
timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'"
@ -647,6 +810,8 @@ elif [ "$dc_only" -eq 1 ]; then
uninstall_prereqs=" uninstall_dc"
uninstall_man_prereqs=" uninstall_dc_manpage"
tests="test_dc"
else
bc=1
@ -654,8 +819,6 @@ else
executables="bc and dc"
link="\$(LINK) \$(BIN) \$(EXEC_PREFIX)\$(DC)"
karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)"
karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)"
@ -672,6 +835,18 @@ else
tests="test_library"
fi
second_target_prereqs="$default_target_prereqs"
default_target_prereqs="$second_target"
default_target_cmd="\$(LINK) \$(BIN) \$(EXEC_PREFIX)\$(DC)"
fi
if [ "$fuzz" -ne 0 ]; then
debug=1
hist=0
prompt=0
nls=0
optimization="3"
fi
if [ "$debug" -eq 1 ]; then
@ -763,16 +938,6 @@ else
uninstall_man_prereqs=""
fi
if [ "$library" -ne 0 ]; then
extra_math=1
nls=0
hist=0
prompt=0
ALL_PREREQ="library"
else
ALL_PREREQ="execs"
fi
if [ "$nls" -ne 0 ]; then
set +e
@ -913,13 +1078,21 @@ else
fi
manpage_args=""
unneeded=""
headers="\$(HEADERS)"
if [ "$extra_math" -eq 0 ]; then
manpage_args="E"
unneeded="$unneeded rand.c"
else
headers="$headers \$(EXTRA_MATH_HEADERS)"
fi
if [ "$hist" -eq 0 ]; then
manpage_args="${manpage_args}H"
unneeded="$unneeded history.c"
else
headers="$headers \$(HISTORY_HEADERS)"
fi
if [ "$nls" -eq 0 ]; then
@ -930,26 +1103,16 @@ if [ "$prompt" -eq 0 ]; then
manpage_args="${manpage_args}P"
fi
if [ "$manpage_args" = "" ]; then
manpage_args="A"
fi
unneeded=""
if [ "$hist" -eq 0 ]; then
unneeded="$unneeded history.c"
fi
if [ "$bc" -eq 0 ]; then
unneeded="$unneeded bc.c bc_lex.c bc_parse.c"
else
headers="$headers \$(BC_HEADERS)"
fi
if [ "$dc" -eq 0 ]; then
unneeded="$unneeded dc.c dc_lex.c dc_parse.c"
fi
if [ "$extra_math" -eq 0 ]; then
unneeded="$unneeded rand.c"
else
headers="$headers \$(DC_HEADERS)"
fi
if [ "$library" -ne 0 ]; then
@ -957,10 +1120,24 @@ if [ "$library" -ne 0 ]; then
unneeded="$unneeded lang.c lex.c parse.c program.c"
unneeded="$unneeded bc.c bc_lex.c bc_parse.c"
unneeded="$unneeded dc.c dc_lex.c dc_parse.c"
headers="$headers \$(LIBRARY_HEADERS)"
else
unneeded="$unneeded library.c"
fi
if [ "$manpage_args" = "" ]; then
manpage_args="A"
fi
if [ "$vg" -ne 0 ]; then
memcheck=1
fi
bc_tests=$(gen_test_targets bc)
bc_script_tests=$(gen_script_test_targets bc)
dc_tests=$(gen_test_targets dc)
dc_script_tests=$(gen_script_test_targets dc)
# Print out the values; this is for debugging.
if [ "$bc" -ne 0 ]; then
printf 'Building bc\n'
@ -978,6 +1155,7 @@ printf 'BC_ENABLE_HISTORY=%s\n' "$hist"
printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math"
printf 'BC_ENABLE_NLS=%s\n' "$nls"
printf 'BC_ENABLE_PROMPT=%s\n' "$prompt"
printf 'BC_ENABLE_AFL=%s\n' "$fuzz"
printf '\n'
printf 'BC_NUM_KARATSUBA_LEN=%s\n' "$karatsuba_len"
printf '\n'
@ -1012,20 +1190,50 @@ replacement='*** WARNING: Autogenerated from Makefile.in. DO NOT MODIFY ***'
contents=$(replace "$contents" "$needle" "$replacement")
if [ "$unneeded" = "" ]; then
contents=$(gen_file_list "$contents" "library.c")
else
contents=$(gen_file_list "$contents" $unneeded)
unneeded="library.c"
fi
contents=$(gen_file_list "$contents" $unneeded)
SRC_TARGETS=""
src_files=$(find_src_files $unneeded)
temp_ifs="$IFS"
IFS=$'\n'
for f in $src_files; do
o=$(replace_ext "$f" "c" "o")
SRC_TARGETS=$(printf '%s\n\n%s: %s %s\n\t$(CC) $(CFLAGS) -o %s -c %s\n' \
"$SRC_TARGETS" "$o" "$headers" "$f" "$o" "$f")
done
IFS="$temp_ifs"
contents=$(replace "$contents" "HEADERS" "$headers")
contents=$(replace "$contents" "BC_ENABLED" "$bc")
contents=$(replace "$contents" "DC_ENABLED" "$dc")
contents=$(replace "$contents" "LINK" "$link")
contents=$(replace "$contents" "BC_ALL_TESTS" "$bc_test")
contents=$(replace "$contents" "BC_TESTS" "$bc_tests")
contents=$(replace "$contents" "BC_SCRIPT_TESTS" "$bc_script_tests")
contents=$(replace "$contents" "BC_TEST_EXEC" "$bc_test_exec")
contents=$(replace "$contents" "TIMECONST_ALL_TESTS" "$timeconst")
contents=$(replace "$contents" "DC_ALL_TESTS" "$dc_test")
contents=$(replace "$contents" "DC_TESTS" "$dc_tests")
contents=$(replace "$contents" "DC_SCRIPT_TESTS" "$dc_script_tests")
contents=$(replace "$contents" "DC_TEST_EXEC" "$dc_test_exec")
contents=$(replace "$contents" "LIBRARY" "$library")
contents=$(replace "$contents" "HISTORY" "$hist")
contents=$(replace "$contents" "EXTRA_MATH" "$extra_math")
contents=$(replace "$contents" "NLS" "$nls")
contents=$(replace "$contents" "PROMPT" "$prompt")
contents=$(replace "$contents" "FUZZ" "$fuzz")
contents=$(replace "$contents" "MEMCHECK" "$memcheck")
contents=$(replace "$contents" "BC_LIB_O" "$bc_lib")
contents=$(replace "$contents" "BC_HELP_O" "$bc_help")
contents=$(replace "$contents" "DC_HELP_O" "$dc_help")
@ -1057,7 +1265,18 @@ contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs")
contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs")
contents=$(replace "$contents" "UNINSTALL_LOCALES_PREREQS" "$uninstall_locales_prereqs")
contents=$(replace "$contents" "DEFAULT_TARGET" "$default_target")
contents=$(replace "$contents" "DEFAULT_TARGET_PREREQS" "$default_target_prereqs")
contents=$(replace "$contents" "DEFAULT_TARGET_CMD" "$default_target_cmd")
contents=$(replace "$contents" "SECOND_TARGET" "$second_target")
contents=$(replace "$contents" "SECOND_TARGET_PREREQS" "$second_target_prereqs")
contents=$(replace "$contents" "SECOND_TARGET_CMD" "$second_target_cmd")
contents=$(replace "$contents" "ALL_PREREQ" "$ALL_PREREQ")
contents=$(replace "$contents" "BC_EXEC_PREREQ" "$bc_exec_prereq")
contents=$(replace "$contents" "BC_EXEC_CMD" "$bc_exec_cmd")
contents=$(replace "$contents" "DC_EXEC_PREREQ" "$dc_exec_prereq")
contents=$(replace "$contents" "DC_EXEC_CMD" "$dc_exec_cmd")
contents=$(replace "$contents" "EXECUTABLES" "$executables")
contents=$(replace "$contents" "MAIN_EXEC" "$main_exec")
@ -1065,10 +1284,7 @@ contents=$(replace "$contents" "EXEC" "$executable")
contents=$(replace "$contents" "TESTS" "$tests")
contents=$(replace "$contents" "BC_TEST" "$bc_test")
contents=$(replace "$contents" "BC_TIME_TEST" "$bc_time_test")
contents=$(replace "$contents" "DC_TEST" "$dc_test")
contents=$(replace "$contents" "DC_TIME_TEST" "$dc_time_test")
contents=$(replace "$contents" "VG_BC_TEST" "$vg_bc_test")
contents=$(replace "$contents" "VG_DC_TEST" "$vg_dc_test")
@ -1086,7 +1302,17 @@ contents=$(replace "$contents" "GEN_EXEC_TARGET" "$GEN_EXEC_TARGET")
contents=$(replace "$contents" "CLEAN_PREREQS" "$CLEAN_PREREQS")
contents=$(replace "$contents" "GEN_EMU" "$GEN_EMU")
printf '%s\n' "$contents" > "$scriptdir/Makefile"
printf '%s\n%s\n\n' "$contents" "$SRC_TARGETS" > "$scriptdir/Makefile"
if [ "$bc" -ne 0 ]; then
gen_tests bc BC "$extra_math" "$time_tests" $bc_test_exec
gen_script_tests bc "$extra_math" "$generate_tests" "$time_tests" $bc_test_exec
fi
if [ "$dc" -ne 0 ]; then
gen_tests dc DC "$extra_math" "$time_tests" $dc_test_exec
gen_script_tests dc "$extra_math" "$generate_tests" "$time_tests" $dc_test_exec
fi
cd "$scriptdir"

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ -59,10 +59,56 @@ err_exit() {
fi
printf '%s\n' "$1"
printf '\nexiting...\n'
exit "$2"
}
checktest_retcode() {
_checktest_retcode_d="$1"
shift
_checktest_retcode_err="$1"
shift
_checktest_retcode_name="$1"
shift
if [ "$_checktest_retcode_err" -ne 0 ]; then
printf 'FAIL!!!\n'
err_exit "$_checktest_retcode_d failed test '$_checktest_retcode_name' with error code $_checktest_retcode_err" 1
fi
}
checktest() {
_checktest_d="$1"
shift
_checktest_err="$1"
shift
_checktest_name="$1"
shift
_checktest_test_path="$1"
shift
_checktest_results_name="$1"
shift
checktest_retcode "$_checktest_d" "$_checktest_err" "$_checktest_name"
_checktest_diff=$(diff "$_checktest_test_path" "$_checktest_results_name")
_checktest_err="$?"
if [ "$_checktest_err" -ne 0 ]; then
printf 'FAIL!!!\n'
printf '%s\n' "$_checktest_diff"
err_exit "$_checktest_d failed test $_checktest_name" 1
fi
}
die() {
_die_d="$1"
@ -99,49 +145,49 @@ checkcrash() {
fi
}
checktest()
checkerrtest()
{
_checktest_d="$1"
_checkerrtest_d="$1"
shift
_checktest_error="$1"
_checkerrtest_error="$1"
shift
_checktest_name="$1"
_checkerrtest_name="$1"
shift
_checktest_out="$1"
_checkerrtest_out="$1"
shift
_checktest_exebase="$1"
_checkerrtest_exebase="$1"
shift
checkcrash "$_checktest_d" "$_checktest_error" "$_checktest_name"
checkcrash "$_checkerrtest_d" "$_checkerrtest_error" "$_checkerrtest_name"
if [ "$_checktest_error" -eq 0 ]; then
die "$_checktest_d" "returned no error" "$_checktest_name" 127
if [ "$_checkerrtest_error" -eq 0 ]; then
die "$_checkerrtest_d" "returned no error" "$_checkerrtest_name" 127
fi
if [ "$_checktest_error" -eq 100 ]; then
if [ "$_checkerrtest_error" -eq 100 ]; then
_checktest_output=$(cat "$_checktest_out")
_checktest_fatal_error="Fatal error"
_checkerrtest_output=$(cat "$_checkerrtest_out")
_checkerrtest_fatal_error="Fatal error"
if [ "${_checktest_output##*$_checktest_fatal_error*}" ]; then
printf "%s\n" "$_checktest_output"
die "$_checktest_d" "had memory errors on a non-fatal error" \
"$_checktest_name" "$_checktest_error"
if [ "${_checkerrtest_output##*$_checkerrtest_fatal_error*}" ]; then
printf "%s\n" "$_checkerrtest_output"
die "$_checkerrtest_d" "had memory errors on a non-fatal error" \
"$_checkerrtest_name" "$_checkerrtest_error"
fi
fi
if [ ! -s "$_checktest_out" ]; then
die "$_checktest_d" "produced no error message" "$_checktest_name" "$_checktest_error"
if [ ! -s "$_checkerrtest_out" ]; then
die "$_checkerrtest_d" "produced no error message" "$_checkerrtest_name" "$_checkerrtest_error"
fi
# Display the error messages if not directly running exe.
# This allows the script to print valgrind output.
if [ "$_checktest_exebase" != "bc" -a "$_checktest_exebase" != "dc" ]; then
cat "$_checktest_out"
if [ "$_checkerrtest_exebase" != "bc" -a "$_checkerrtest_exebase" != "dc" ]; then
cat "$_checkerrtest_out"
fi
}

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -43,7 +43,7 @@
#include <libgen.h>
static const char* const bc_gen_header =
"// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n"
"// Copyright (c) 2018-2021 Gavin D. Howard and contributors.\n"
"// Licensed under the 2-clause BSD license.\n"
"// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n";

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@ -64,7 +64,7 @@ if [ -n "$remove_tabs" ]; then
fi
cat<<EOF
// Copyright (c) 2018-2020 Gavin D. Howard and contributors.
// Copyright (c) 2018-2021 Gavin D. Howard and contributors.
// Licensed under the 2-clause BSD license.
// *** AUTOMATICALLY GENERATED FROM ${input}. DO NOT MODIFY. ***

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -236,7 +236,9 @@ void bc_num_zero(BcNum *restrict n);
void bc_num_one(BcNum *restrict n);
ssize_t bc_num_cmpZero(const BcNum *n);
#if !defined(NDEBUG) || BC_ENABLE_LIBRARY
bool bc_num_strValid(const char *restrict val);
#endif // !defined(NDEBUG) || BC_ENABLE_LIBRARY
void bc_num_parse(BcNum *restrict n, const char *restrict val, BcBigDig base);
void bc_num_print(BcNum *restrict n, BcBigDig base, bool newline);
#if DC_ENABLED

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -1,32 +1,4 @@
/*
* *****************************************************************************
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2019 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* *****************************************************************************
*
* Parts of this code are adapted from the following:
@ -38,9 +10,10 @@
*
* -----------------------------------------------------------------------------
*
* Parts of this code are also under the following license:
* This code is under the following license:
*
* Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -46,6 +46,16 @@
#define DC_ENABLED (1)
#endif // DC_ENABLED
#if BC_ENABLE_AFL
#ifndef __AFL_HAVE_MANUAL_CONTROL
#error Must compile with afl-clang-fast for fuzzing
#endif // __AFL_HAVE_MANUAL_CONTROL
#endif // BC_ENABLE_AFL
#ifndef BC_ENABLE_MEMCHECK
#define BC_ENABLE_MEMCHECK (0)
#endif // BC_ENABLE_MEMCHECK
#include <bcl.h>
typedef enum BcStatus {
@ -173,7 +183,7 @@ typedef enum BcErr {
#endif // defined(__has_attribute) && __has_attribute(fallthrough)
#else // defined(__clang__) || defined(__GNUC__)
#define BC_FALLTHROUGH
#endif //defined(__clang__) || defined(__GNUC__)
#endif // defined(__clang__) || defined(__GNUC__)
// Workarounds for AIX's POSIX incompatibility.
#ifndef SIZE_MAX

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -91,6 +91,7 @@ bool bc_map_insert(BcVec *restrict v, const char *name,
size_t bc_map_index(const BcVec *restrict v, const char *name);
#define bc_vec_pop(v) (bc_vec_npop((v), 1))
#define bc_vec_popAll(v) (bc_vec_npop((v), (v)->len))
#define bc_vec_top(v) (bc_vec_item_rev((v), 0))
#ifndef NDEBUG

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2020 Gavin D. Howard and contributors.
* Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@ -318,7 +318,7 @@ typedef struct BcVm {
#if !BC_ENABLE_LIBRARY
BcParse prs;
BcProgram prog;
#endif // BC_ENABLE_LIBRARY
#endif // !BC_ENABLE_LIBRARY
BcVec jmp_bufs;
@ -343,7 +343,7 @@ typedef struct BcVm {
const char* file;
const char *sigmsg;
#endif // BC_ENABLE_LIBRARY
#endif // !BC_ENABLE_LIBRARY
volatile sig_atomic_t sig_lock;
volatile sig_atomic_t sig;
#if !BC_ENABLE_LIBRARY
@ -357,7 +357,7 @@ typedef struct BcVm {
bool no_exit_exprs;
bool eof;
#endif // BC_ENABLE_LIBRARY
#endif // !BC_ENABLE_LIBRARY
BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH];
@ -382,7 +382,7 @@ typedef struct BcVm {
const char *err_msgs[BC_ERR_NELEMS];
const char *locale;
#endif // BC_ENABLE_LIBRARY
#endif // !BC_ENABLE_LIBRARY
BcBigDig last_base;
BcBigDig last_pow;
@ -392,7 +392,7 @@ typedef struct BcVm {
#if !BC_ENABLE_LIBRARY
char *env_args_buffer;
BcVec env_args;
#endif // BC_ENABLE_LIBRARY
#endif // !BC_ENABLE_LIBRARY
BcNum max;
BcNum max2;
@ -436,8 +436,15 @@ void bc_vm_jmp(void);
#if BC_ENABLE_LIBRARY
void bc_vm_handleError(BcErr e);
void bc_vm_fatalError(BcErr e);
void bc_vm_atexit(void);
#else // BC_ENABLE_LIBRARY
void bc_vm_handleError(BcErr e, size_t line, ...);
#if !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK
BC_NORETURN
#endif // !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK
void bc_vm_fatalError(BcErr e);
int bc_vm_atexit(int status);
#endif // BC_ENABLE_LIBRARY
extern const char bc_copyright[];

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2020 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2021 Gavin D. Howard and contributors.
$ $
$ Redistribution and use in source and binary forms, with or without
$ modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -459,7 +459,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
{{ end }}
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -519,6 +519,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -403,7 +403,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -399,7 +399,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -399,7 +399,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -509,6 +509,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -395,7 +395,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -509,6 +509,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -395,7 +395,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -519,6 +519,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -403,7 +403,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -399,7 +399,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH NAME
.PP
bc - arbitrary-precision decimal arithmetic language and calculator
@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -399,7 +399,10 @@ generator.
**Note**: The values returned by the pseudo-random number generator with
**rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they *are* guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
## Numbers

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "BCL" "3" "October 2020" "Gavin D. Howard" "Libraries Manual"
.TH "BCL" "3" "January 2021" "Gavin D. Howard" "Libraries Manual"
.SH NAME
.PP
bcl - library of arbitrary precision decimal arithmetic

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2020 Gavin D. Howard and contributors.
Copyright (c) 2018-2021 Gavin D. Howard and contributors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@ -208,7 +208,10 @@ command or the **"** command that does not get receive a value of **0** or
**Note**: The values returned by the pseudo-random number generator with the
**'** and **"** commands are guaranteed to **NOT** be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator. However,
they **are** guaranteed to be reproducible with identical **seed** values.
they *are* guaranteed to be reproducible with identical **seed** values. This
means that the pseudo-random values from bc(1) should only be used where a
reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case,
use a non-seeded pseudo-random number generator.
The pseudo-random number generator, **seed**, and all associated operations are
**non-portable extensions**.

View File

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual"
.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual"
.SH Name
.PP
dc - arbitrary-precision decimal reverse-Polish notation calculator
@ -233,8 +233,12 @@ queried with the \f[B]W\f[R] command.
generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are
guaranteed to \f[B]NOT\f[R] be cryptographically secure.
This is a consequence of using a seeded pseudo-random number generator.
However, they \f[B]are\f[R] guaranteed to be reproducible with identical
However, they \f[I]are\f[R] guaranteed to be reproducible with identical
\f[B]seed\f[R] values.
This means that the pseudo-random values from bc(1) should only be used
where a reproducible stream of pseudo-random numbers is
\f[I]ESSENTIAL\f[R].
In any other case, use a non-seeded pseudo-random number generator.
.PP
The pseudo-random number generator, \f[B]seed\f[R], and all associated
operations are \f[B]non-portable extensions\f[R].

Some files were not shown because too many files have changed in this diff Show More