contrib/bc upgrade to version 7.1.0

This update fixes a few bugs:
- Improper response to double SIGINT with editline.
- Not letting libedit handle terminal size changes.
- A dc crash from improperly handling an error.
- A duplicate check for reference arrays.
- Build failures with GCC 15.

Merge commit '682da5a0fdb2c38ecc3951047a882471d62aa1d1'
This commit is contained in:
Stefan Eßer 2025-09-11 16:16:39 +02:00
commit fdc4a7c801
713 changed files with 28217 additions and 3011 deletions

View file

@ -1,6 +1,6 @@
# License
Copyright (c) 2018-2024 Gavin D. Howard <gavin@gavinhoward.com>
Copyright (c) 2018-2025 Gavin D. Howard <gavin@gavinhoward.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@ -60,7 +60,7 @@ 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<br>
Copyright (c) 2018-2024 Gavin D. Howard <gavin@gavinhoward.com>
Copyright (c) 2018-2025 Gavin D. Howard <gavin@gavinhoward.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

View file

@ -0,0 +1,80 @@
# Maintenance Terms
> Last Updated: 27 June 2025
The code, text, and other materials in this repository are provided as-is under
the terms of the repository's [`LICENSE.md`][0] file, as a gift to the commons
and the common good. In providing this software as-is, its author(s) admit no
further obligations from anyone using the software for any reason, particularly
with respect to:
* Releases,
* Response time,
* Change review and integration,
* Disclosure schedules,
* Discretionary, proprietary or otherwise secretive communications, and
* Any other non-contractual obligations or conventions, regardless of their
presumed urgency or severity.
Should anyone wish to make a contract with me (Gavin Howard) to ensure that work
he or she deems critical gets done, the terms are as follows:
* Compute time will be charged at \$25/hr.
* My time will be charged at \$100/hr.
* All issues deemed critical by either me or the requester, that also change the
source code (anything in `gen`, `include`, or `src`) will require at least two
weeks of fuzzing without error.
* If errors are found, those hours will still be charged on top of the final
two weeks.
* All changes will require running the [release script][2] on Linux (GCC), Linux
(Clang), FreeBSD, OpenBSD, macOS, Windows.
* Any hours spent on bugs or code that have been, or are suspected to have been,
generated by "AI" will be charged double rates.
Compute time includes, but is not limited to:
* Fuzzing.
* Running my [release script][2].
* Running tests and my [release script][2] on macOS.
My time includes, but is not limited to:
* Code review.
* Reading bug reports.
* Design.
* Coding.
* Any compute time that interferes with my ability to do any other work:
* Fuzzing makes my computer unusable, so fuzzing for the 8-12 hours of the
day that I could be working will be charged at \$100/hr.
* Same with running my [release script][2] because I run two instances on my
machine and two in VMs at the same time.
* Running my [release script][2] or any other compute time on Windows
because Windows blocks me from doing my main work on Linux.
* Any other instances of blocking compute time.
All amounts will be billed by, and paid to, [Yzena, LLC][2]. Invoices will be
provided, including line items for what each hour was spent on.
It is suggested that the following amounts be budgeted:
* At least \$3000 for a non-critical issue or change.
The release script takes about 10 hours, and I would need to run it once on
Linux (and others at the same time) and once on Windows, which is 20 hours.
Most of that won't be at the \$100/hr rate, but some probably will be. Then
an extra \$1000 for other work.
* At least \$15,000 for a critical issue or change.
The \$3000 above is the start, which leaves \$12,000. Fuzzing is expected to
cost \$11,400 (6 days a week, 8 hours a day, at \$100, the rest at \$25), and
rounded up to \$12,000 for good measure.
---
This document is inspired by [Mike Hoye's Maintenance Terms][1].
[0]: LICENSE.md
[1]: https://github.com/mhoye/maintenance-terms
[2]: scripts/release.sh
[3]: https://yzena.com/

View file

@ -1,7 +1,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2024 Gavin D. Howard and contributors.
# Copyright (c) 2018-2025 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:
@ -38,6 +38,8 @@ GENDIR = $(ROOTDIR)/gen
BUILDDIR = %%BUILDDIR%%
VERSION = %%VERSION%%
SRC = %%SRC%%
OBJ = %%OBJ%%
GCDA = %%GCDA%%
@ -99,17 +101,16 @@ BC_FUZZER_C = $(BIN)/$(BC)_fuzzer_C
DC_FUZZER = $(BIN)/$(DC)_fuzzer_c
DC_FUZZER_C = $(BIN)/$(DC)_fuzzer_C
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)
BCL = bcl
BCL_TEST = $(BIN)/$(BCL)
BCL_TEST_C = $(TESTSDIR)/$(BCL).c
GENERATE_TESTS = %%GENERATE_TESTS%%
PROBLEMATIC_TESTS = %%PROBLEMATIC_TESTS%%
MANUALS = manuals
BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1
@ -152,11 +153,11 @@ BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%%
BC_ENABLE_NLS = %%NLS%%
BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%%
BC_ENABLE_AFL = %%FUZZ%%
BC_ENABLE_OSSFUZZ = %%OSSFUZZ%%
BC_ENABLE_MEMCHECK = %%MEMCHECK%%
BC_ENABLE_AFL = 0
BC_ENABLE_OSSFUZZ = 0
BC_ENABLE_MEMCHECK = 0
LIB_FUZZING_ENGINE = %%LIB_FUZZING_ENGINE%%
LIB_FUZZING_ENGINE = 0
BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%%
BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%%
@ -189,10 +190,6 @@ KARATSUBA = $(SCRIPTSDIR)/karatsuba.py
LOCALE_INSTALL = $(SCRIPTSDIR)/locale_install.sh
LOCALE_UNINSTALL = $(SCRIPTSDIR)/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%%
BC_DEFS0 = -DBC_DEFAULT_BANNER=$(BC_DEFAULT_BANNER)
@ -218,7 +215,7 @@ 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)
CPPFLAGS9 = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL)
CPPFLAGS = $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ)
CPPFLAGS = -DVERSION=$(VERSION) $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ)
CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%%
LDFLAGS = %%LDFLAGS%%
@ -293,236 +290,10 @@ help:
@printf ' check alias for `make test`\n'
@printf ' clean removes all build files\n'
@printf ' clean_config removes all build files as well as the generated Makefile\n'
@printf ' clean_tests removes all build files, the generated Makefile,\n'
@printf ' and generated tests\n'
@printf ' install installs binaries to "%s%s"\n' "$(DESTDIR)" "$(BINDIR)"
@printf ' and (if enabled) manpages to "%s%s"\n' "$(DESTDIR)" "$(MAN1DIR)"
@printf ' karatsuba runs the karatsuba script (requires Python 3)\n'
@printf ' karatsuba_test runs the karatsuba script while running tests\n'
@printf ' (requires Python 3)\n'
@printf ' uninstall uninstalls binaries from "%s%s"\n' "$(DESTDIR)" "$(BINDIR)"
@printf ' and (if enabled) manpages from "%s%s"\n' "$(DESTDIR)" "$(MAN1DIR)"
@printf ' test runs the test suite\n'
@printf ' test_bc runs the bc test suite, if bc has been built\n'
@printf ' test_dc runs the dc test suite, if dc has been built\n'
@printf ' time_test runs the test suite, displaying times for some things\n'
@printf ' time_test_bc runs the bc test suite, displaying times for some things\n'
@printf ' time_test_dc runs the dc test suite, displaying times for some things\n'
@printf ' timeconst runs the test on the Linux timeconst.bc script,\n'
@printf ' if it exists and bc has been built\n'
run_all_tests: bc_all_tests timeconst_all_tests dc_all_tests
run_all_tests_np: bc_all_tests_np timeconst_all_tests dc_all_tests_np
bc_all_tests:
%%BC_ALL_TESTS%%
bc_all_tests_np:
%%BC_ALL_TESTS_NP%%
timeconst_all_tests:
%%TIMECONST_ALL_TESTS%%
dc_all_tests:
%%DC_ALL_TESTS%%
dc_all_tests_np:
%%DC_ALL_TESTS_NP%%
history_all_tests:
%%HISTORY_TESTS%%
check: test
test: %%TESTS%%
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%%
test_bc_scripts:%%BC_SCRIPT_TESTS%%
test_bc_stdin:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/stdin.sh bc %%BC_TEST_EXEC%%
test_bc_read:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/read.sh bc %%BC_TEST_EXEC%%
test_bc_errors: test_bc_error_lines%%BC_ERROR_TESTS%%
test_bc_error_lines:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/errors.sh bc %%BC_TEST_EXEC%%
test_bc_other:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/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_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%%
test_dc_scripts:%%DC_SCRIPT_TESTS%%
test_dc_stdin:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/stdin.sh dc %%DC_TEST_EXEC%%
test_dc_read:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/read.sh dc %%DC_TEST_EXEC%%
test_dc_errors: test_dc_error_lines%%DC_ERROR_TESTS%%
test_dc_error_lines:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/errors.sh dc %%DC_TEST_EXEC%%
test_dc_other:
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/other.sh dc $(BC_ENABLE_EXTRA_MATH) %%DC_TEST_EXEC%%
test_dc_header:
@printf '$(TEST_STARS)\n\nRunning dc tests...\n\n'
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 $(TESTSDIR)/history.sh bc 0 %%BC_TEST_EXEC%%
test_bc_history1:
@sh $(TESTSDIR)/history.sh bc 1 %%BC_TEST_EXEC%%
test_bc_history2:
@sh $(TESTSDIR)/history.sh bc 2 %%BC_TEST_EXEC%%
test_bc_history3:
@sh $(TESTSDIR)/history.sh bc 3 %%BC_TEST_EXEC%%
test_bc_history4:
@sh $(TESTSDIR)/history.sh bc 4 %%BC_TEST_EXEC%%
test_bc_history5:
@sh $(TESTSDIR)/history.sh bc 5 %%BC_TEST_EXEC%%
test_bc_history6:
@sh $(TESTSDIR)/history.sh bc 6 %%BC_TEST_EXEC%%
test_bc_history7:
@sh $(TESTSDIR)/history.sh bc 7 %%BC_TEST_EXEC%%
test_bc_history8:
@sh $(TESTSDIR)/history.sh bc 8 %%BC_TEST_EXEC%%
test_bc_history9:
@sh $(TESTSDIR)/history.sh bc 9 %%BC_TEST_EXEC%%
test_bc_history10:
@sh $(TESTSDIR)/history.sh bc 10 %%BC_TEST_EXEC%%
test_bc_history11:
@sh $(TESTSDIR)/history.sh bc 11 %%BC_TEST_EXEC%%
test_bc_history12:
@sh $(TESTSDIR)/history.sh bc 12 %%BC_TEST_EXEC%%
test_bc_history13:
@sh $(TESTSDIR)/history.sh bc 13 %%BC_TEST_EXEC%%
test_bc_history14:
@sh $(TESTSDIR)/history.sh bc 14 %%BC_TEST_EXEC%%
test_bc_history15:
@sh $(TESTSDIR)/history.sh bc 15 %%BC_TEST_EXEC%%
test_bc_history16:
@sh $(TESTSDIR)/history.sh bc 16 %%BC_TEST_EXEC%%
test_bc_history17:
@sh $(TESTSDIR)/history.sh bc 17 %%BC_TEST_EXEC%%
test_bc_history18:
@sh $(TESTSDIR)/history.sh bc 18 %%BC_TEST_EXEC%%
test_bc_history19:
@sh $(TESTSDIR)/history.sh bc 19 %%BC_TEST_EXEC%%
test_bc_history20:
@sh $(TESTSDIR)/history.sh bc 20 %%BC_TEST_EXEC%%
test_bc_history21:
@sh $(TESTSDIR)/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_history10
test_dc_history_skip:
@printf 'No dc history tests to run\n'
test_dc_history0:
@sh $(TESTSDIR)/history.sh dc 0 %%DC_TEST_EXEC%%
test_dc_history1:
@sh $(TESTSDIR)/history.sh dc 1 %%DC_TEST_EXEC%%
test_dc_history2:
@sh $(TESTSDIR)/history.sh dc 2 %%DC_TEST_EXEC%%
test_dc_history3:
@sh $(TESTSDIR)/history.sh dc 3 %%DC_TEST_EXEC%%
test_dc_history4:
@sh $(TESTSDIR)/history.sh dc 4 %%DC_TEST_EXEC%%
test_dc_history5:
@sh $(TESTSDIR)/history.sh dc 5 %%DC_TEST_EXEC%%
test_dc_history6:
@sh $(TESTSDIR)/history.sh dc 6 %%DC_TEST_EXEC%%
test_dc_history7:
@sh $(TESTSDIR)/history.sh dc 7 %%DC_TEST_EXEC%%
test_dc_history8:
@sh $(TESTSDIR)/history.sh dc 8 %%DC_TEST_EXEC%%
test_dc_history9:
@sh $(TESTSDIR)/history.sh dc 9 %%DC_TEST_EXEC%%
test_dc_history10:
@sh $(TESTSDIR)/history.sh dc 10 %%DC_TEST_EXEC%%
test_history_header:
@printf '$(TEST_STARS)\n\nRunning history tests...\n\n'
library_test: $(LIBBC)
$(CC) $(CFLAGS) -lpthread $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST)
test_library: library_test
%%BCL_TEST_EXEC%%
karatsuba:
%%KARATSUBA%%
karatsuba_test:
%%KARATSUBA_TEST%%
coverage_output:
%%COVERAGE_OUTPUT%%
coverage:%%COVERAGE_PREREQS%%
manpages:
$(MANPAGE) bc
@ -559,37 +330,25 @@ clean_config: clean clean_benchmarks
@$(RM) -f compile_commands.json
@$(RM) -f $(BCL_PC)
clean_coverage:
@printf 'Cleaning coverage files...\n'
@$(RM) -f *.gcov
@$(RM) -f *.html *.css
@$(RM) -f *.gcda *.gcno
@$(RM) -f *.profraw
@$(RM) -f $(GCDA) $(GCNO)
@$(RM) -f $(BC_GCDA) $(BC_GCNO)
@$(RM) -f $(DC_GCDA) $(DC_GCNO)
@$(RM) -f $(HISTORY_GCDA) $(HISTORY_GCNO)
@$(RM) -f $(RAND_GCDA) $(RAND_GCNO)
@$(RM) -f $(BC_LIB_GCDA) $(BC_LIB_GCNO)
@$(RM) -f $(BC_LIB2_GCDA) $(BC_LIB2_GCNO)
@$(RM) -f $(BC_HELP_GCDA) $(BC_HELP_GCNO)
@$(RM) -f $(DC_HELP_GCDA) $(DC_HELP_GCNO)
test:
@if [ $(BC_ENABLED) -ne 0 ]; then $(TESTSDIR)/all.sh -n bc $(BC_ENABLE_EXTRA_MATH) 1 $(GENERATE_TESTS) $(PROBLEMATIC_TESTS) $(BC_EXEC); fi
@if [ $(DC_ENABLED) -ne 0 ]; then $(TESTSDIR)/all.sh -n dc $(BC_ENABLE_EXTRA_MATH) 1 $(GENERATE_TESTS) $(PROBLEMATIC_TESTS) $(DC_EXEC); fi
clean_tests: clean clean_config clean_coverage
clean_tests: clean clean_config
@printf 'Cleaning test files...\n'
@$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS)
@$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS)
@$(RM) -f $(TESTSDIR)/bc/parse.txt $(TESTSDIR)/bc/parse_results.txt
@$(RM) -f $(TESTSDIR)/bc/print.txt $(TESTSDIR)/bc/print_results.txt
@$(RM) -f $(TESTSDIR)/bc/parse_*.txt $(TESTSDIR)/bc/parse_*_results.txt
@$(RM) -f $(TESTSDIR)/bc/print_*.txt $(TESTSDIR)/bc/print_*_results.txt
@$(RM) -f $(TESTSDIR)/bc/bessel.txt $(TESTSDIR)/bc/bessel_results.txt
@$(RM) -f $(TESTSDIR)/bc/strings2.txt $(TESTSDIR)/bc/strings2_results.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/bessel.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/parse.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/print.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/add.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/divide.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/multiply.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/subtract.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/add_*.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/divide_*.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/multiply_*.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/subtract_*.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/strings2.txt
@$(RM) -f $(TESTSDIR)/dc/scripts/prime.txt
@$(RM) -f .log_*.txt

View file

@ -1,5 +1,27 @@
# News
## 7.1.0
This is an ***UNTESTED*** release. If you would like testing, see the
[maintenance terms][23].
This fixes a few bugs:
* Improper response to double `SIGINT` with editline.
* Not letting `libedit` handle terminal size changes.
* A `dc` crash from improperly handling an error.
* A duplicate check for reference arrays.
* Build failures with GCC 15.
It also has a performance increase in the `band()` function and others in the
math library.
## 7.0.3
This is a production release that fixes build warnings on the musl libc.
Other users do ***NOT*** need to upgrade.
## 7.0.2
This is a production release that fixes `Ctrl+d` on FreeBSD and Linux when using
@ -1588,3 +1610,4 @@ not thoroughly tested.
[20]: https://github.com/apjanke/ronn-ng
[21]: https://pandoc.org/
[22]: ./scripts/locale_uninstall.sh
[23]: ./MAINTENANCE-TERMS.md

View file

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

View file

@ -1,9 +1,7 @@
# `bc`
***WARNING: New user registration for <https://git.gavinhoward.com/> is disabled
because of spam. If you need to report a bug with `bc`, email gavin at this site
minus the `git.` part for an account, and I will create one for you. Or you can
report an issue at [GitHub][29].***
***WARNING: This project has moved back to GitHub temporarily; self-hosted Git
forges are not working for me, so I am trying to replace them.***
***WARNING: This project has moved to [https://git.gavinhoward.com/][20] for
[these reasons][21], though GitHub will remain a mirror.***
@ -282,6 +280,12 @@ The easiest way to run this script is with `make karatsuba`.
If desired, maintainers can also skip running this script because there is a
sane default for the Karatsuba number.
##### `timeconst.bc`
The test suite will print a warning in normal usage. The warning is about a
missing `timeconst.bc`. This file [comes from][37] the [Linux kernel][38], which
has an incompatible license. The warning can be ignored.
## Status
This `bc` is robust.
@ -432,6 +436,8 @@ Other projects based on this bc are:
* [macOS `bc`][35]. Any bugs in that `bc` should be reported to me, but do
expect bugs because the version is old.
* [Android Open Source `bc`][32]. Any bugs in that `bc` can be reported here.
* [A Fedora package][36]. If this package does not have any patches, you can
report bugs to me.
This is a non-comprehensive list of Linux distros that use this `bc` as the
system `bc`:
@ -469,12 +475,16 @@ Files:
.gitignore The git ignore file (maintainer use only).
.gitattributes The git attributes file (maintainer use only).
bcl.pc.in A template pkg-config file for bcl.
build.gaml The GAML file with options for building under Rig.
build.pkg.rig The Rig build package file.
build.rig The Rig build script.
configure A symlink to configure.sh to make packaging easier.
configure.sh The configure script.
LICENSE.md A Markdown form of the BSD 2-clause License.
Makefile.in The Makefile template.
NEWS.md The changelog.
NOTICE.md List of contributors and copyright owners.
VERSION.txt A file containing the version.
Folders:
@ -516,3 +526,6 @@ Folders:
[33]: https://github.com/gentoo/gentoo/blob/master/app-alternatives/bc/bc-0.ebuild#L8
[34]: https://www.linuxfromscratch.org/lfs/view/stable/chapter08/bc.html
[35]: https://github.com/apple-oss-distributions/bc/tree/main/bc
[36]: https://copr.fedorainfracloud.org/coprs/tkbcopr/bc-gh/
[37]: https://github.com/torvalds/linux/blob/master/kernel/time/timeconst.bc
[38]: https://github.com/torvalds/linux

1
contrib/bc/VERSION.txt Normal file
View file

@ -0,0 +1 @@
7.1.0

402
contrib/bc/build.gaml Normal file
View file

@ -0,0 +1,402 @@
/*
* *****************************************************************************
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2025 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.
*
* *****************************************************************************
*
* The build options file.
*
*/
project: @com.gavinhoward.bc
language: @C11
version: {
min: @24.04.05
}
mode: {
language: @iterative
stampers: @metadata
dependencies: @dynamic
}
default_target: @all
presets: {
debug: {
debug: true
optimization: "0"
memcheck: true
devtools: true
strip: false
}
release: {
optimization: "3"
lto: true
}
// This is the predefined build for BSDs.
bsd: {
optimization: "3"
history: @editline
generated_tests: false
install_manpages: false
install_locales: @system
strip: true
bc_default_banner: false
bc_default_sigint_reset: true
dc_default_sigint_reset: true
bc_default_tty_mode: true
dc_default_tty_mode: false
bc_default_prompt: @off
dc_default_prompt: @off
bc_default_expr_exit: true
dc_default_expr_exit: true
bc_default_digit_clamp: false
dc_default_digit_clamp: false
}
// This is the predefined build to match the GNU bc/dc.
gnu: {
optimization: "3"
generated_tests: false
install_manpages: true
install_locales: @system
strip: true
bc_default_banner: true
bc_default_sigint_reset: true
dc_default_sigint_reset: false
bc_default_tty_mode: true
dc_default_tty_mode: false
bc_default_prompt: @tty_mode
dc_default_prompt: @tty_mode
bc_default_expr_exit: true
dc_default_expr_exit: true
bc_default_digit_clamp: false
dc_default_digit_clamp: false
}
// This is the preferred release build of the author, Gavin D. Howard.
gdh: {
optimization: "3"
install_manpages: true
install_locales: @none
bc/default_banner: true
bc/default_sigint_reset: true
dc/default_sigint_reset: true
bc/default_tty_mode: true
dc/default_tty_mode: true
bc/default_prompt: @tty_mode
dc/default_prompt: @tty_mode
bc/default_expr_exit: false
dc/default_expr_exit: false
bc/default_digit_clamp: true
dc/default_digit_clamp: true
}
// This is the preferred debug build of the author, Gavin D. Howard.
dbg: {
optimization: "0"
debug: true
strip: false
install_manpages: true
install_locales: @system
bc/default_banner: true
bc/default_sigint_reset: true
dc/default_sigint_reset: true
bc/default_tty_mode: true
dc/default_tty_mode: true
bc/default_prompt: @tty_mode
dc/default_prompt: @tty_mode
bc/default_expr_exit: false
dc/default_expr_exit: false
bc/default_digit_clamp: true
dc/default_digit_clamp: true
}
}
default_development: @debug
default_release: @release
options: {
build_mode: {
type: @option
options: [
@both
@bc
@dc
@library
]
default: @both
desc: "Which of the executables or library to build."
}
extra_math: {
type: @bool
default: true
desc: "Enable the extra math extensions."
}
history: {
type: @option
options: [
@none
@builtin
@editline
@readline
]
default: @builtin
desc: "Which history implementation should be used, if any."
}
locales: {
type: @option
options: [
@none
@system
@all
]
default: @system
desc: "Whether to disable locales, use just the system ones, or use all (for building a package)."
}
bc/default_banner: {
type: @bool
default: false
desc: "Whether to display the bc version banner by default when in interactive mode."
}
bc/default_sigint_reset: {
type: @bool
default: true
desc: "Whether SIGINT will reset bc by default, instead of exiting, when in interactive mode."
}
dc/default_sigint_reset: {
type: @bool
default: true
desc: "Whether SIGINT will reset dc by default, instead of exiting, when in interactive mode."
}
bc/default_tty_mode: {
type: @bool
default: true
desc: "Whether TTY mode for bc should be on by default when available."
}
dc/default_tty_mode: {
type: @bool
default: false
desc: "Whether TTY mode for dc should be on by default when available."
}
bc/default_prompt: {
type: @option
options: [
@off
@tty_mode
@on
]
default: @tty_mode
desc: "Whether the prompt for bc should be on by default in TTY mode. This defaults to match TTY mode."
}
dc/default_prompt: {
type: @option
options: [
@off
@tty_mode
@on
]
default: @tty_mode
desc: "Whether the prompt for dc should be on by default in TTY mode. This defaults to match TTY mode."
}
bc/default_expr_exit: {
type: @bool
default: true
desc: "Whether to exit bc by default if an expression or expression file is given with the -e or -f options."
}
dc/default_expr_exit: {
type: @bool
default: true
desc: "Whether to exit dc by default if an expression or expression file is given with the -e or -f options."
}
bc/default_digit_clamp: {
type: @bool
default: false
desc: "Whether to have bc, by default, clamp digits that are greater than or equal to the current ibase when parsing numbers."
}
dc/default_digit_clamp: {
type: @bool
default: false
desc: "Whether to have dc, by default, clamp digits that are greater than or equal to the current ibase when parsing numbers."
}
karatsuba_len: {
type: @num
default: 32
desc: "Set the Karatsuba length (default is 32). Must be a number and greater than or equal to 16."
}
execprefix: {
type: @string
default: ""
desc: "The prefix to prepend to the executable names, to prevent collisions."
}
execsuffix: {
type: @string
default: ""
desc: "The suffix to append to the executable names, to prevent collisions."
}
debug: {
type: @bool
default: false
desc: "Enable debug info."
}
optimization: {
type: @string
default: "0"
desc: "The optimization level for the C compiler."
}
lto: {
type: @bool
default: false
desc: "Build with link-time optimization, if available."
}
strip: {
type: @bool
default: true
desc: "Strip any binaries."
}
strict: {
type: @bool
default: true
desc: "Build with strict compiler options."
}
force: {
type: @bool
default: false
desc: "Force options that don't work. THIS IS FOR DEV ONLY!"
}
memcheck: {
type: @bool
default: false
desc: "Enable memcheck mode, to check for memory leaks."
}
valgrind: {
type: @bool
default: false
desc: "Enable Valgrind mode, to check for memory bugs."
}
afl: {
type: @bool
default: false
desc: "Enable AFL++ mode."
}
ossfuzz: {
type: @bool
default: false
desc: "Enable OSSFUZZ mode."
}
generated_tests: {
type: @bool
default: true
desc: "Enable tests generated from a GNU bc-compatible program."
}
problematic_tests: {
type: @bool
default: true
desc: "Enable tests that may be problematic."
}
coverage: {
type: @bool
default: false
desc: "Enable code coverage (only works on GCC)."
}
install_manpages: {
type: @bool
default: true
desc: "Whether to install manpages or not."
}
cflags: {
type: @list
default: []
desc: "The command-line flags for the C compiler."
}
ldflags: {
type: @list
default: []
desc: "The command-line flags for the C linker."
}
destdir: {
type: @path
default: ""
desc: "The equivalent of $DESTDIR in other build systems."
}
prefix: {
type: @path
default: "/usr/local"
desc: "The default prefix to install everything into."
}
bindir: {
type: @path
default: ""
desc: "The directory to install executables into. Defaults to \"$prefix/bin\"."
}
libdir: {
type: @path
default: ""
desc: "The directory to install libraries into. Defaults to \"$prefix/lib\"."
}
includedir: {
type: @path
default: ""
desc: "The location to install headers in. Defaults to \"$prefix/include\"."
}
nlspath: {
type: @path
default: "/usr/share/locale/%L/%N"
desc: "The location to install locales."
}
pc_path: {
type: @path
default: ""
desc: "The location to pkg-config files to. Defaults to the output of `pkg-config --variable=pc_path pkg-config`."
}
datarootdir: {
type: @path
default: ""
desc: "The root directory for data files. Defaults to `$prefix/share`."
}
datadir: {
type: @path
default: ""
desc: "The directory for data files. Defaults to `$datarootdir`."
}
mandir: {
type: @path
default: ""
desc: "The root directory for manpages. Defaults to `$datadir/man`."
}
man1dir: {
type: @path
default: ""
desc: "The directory for manpages in section 1. Defaults to `$mandir/man1`."
}
man3dir: {
type: @path
default: ""
desc: "The directory for manpages in section 3. Defaults to `$mandir/man3`."
}
}

2345
contrib/bc/build.pkg.rig Normal file

File diff suppressed because it is too large Load diff

575
contrib/bc/build.rig Normal file
View file

@ -0,0 +1,575 @@
/*
* *****************************************************************************
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2025 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.
*
* *****************************************************************************
*
* The build script file.
*
*/
if OS == "Windows" && bool(config["lto"])
{
error("Link-time optimization is not supported on Windows");
}
if LIBRARY_ENABLED == "0"
{
if OS != "Windows" && NLS_ENABLED != "0"
{
io.eprint("Testing NLS...\n");
clang_flags: []str =
if CC contains "clang"
{
@[ "-Wno_unreachable-code" ];
};
flags: []str = clang_flags +~ @[
DEFOPT +~ "BC_ENABLE_NLS=1",
DEFOPT +~ "BC_ENABLED=" +~ BC_ENABLED,
DEFOPT +~ "DC_ENABLED=" +~ DC_ENABLED,
DEFOPT +~ "BC_ENABLE_HISTORY=0",
DEFOPT +~ "BC_ENABLE_LIBRARY=0",
DEFOPT +~ "BC_ENABLE_AFL=0",
DEFOPT +~ "BC_ENABLE_EXTRA_MATH=" +~ EXTRA_MATH_ENABLED,
DEFOPT +~ "BC_ENABLE_OSSFUZZ=0",
DEFOPT +~ "_POSIX_C_SOURCE=200809L",
DEFOPT +~ "_XOPEN_SOURCE=700",
INCOPT,
];
res := $ $CC %(flags) -c @(path.join(src_dir, "src/vm.c")) -E;
if res.exitcode != 0
{
if FORCE
{
io.eprint("Forcing NLS...\n");
}
else
{
error("NLS does not work\n");
}
}
else
{
if path.isfile("vm.o")
{
path.rm("vm.o");
}
io.eprint("NLS works.\n\n");
io.eprint("Testing gencat...\n");
res2 := $ gencat ./en_US.cat
@(path.join(src_dir, "locales/en_US.msg"));
if res2.exitcode != 0
{
if FORCE
{
io.eprint("Forcing NLS...\n");
}
else
{
error("gencat does not work\n");
}
}
else
{
io.eprint("gencat works.\n\n");
if platform != host
{
error("Cross compiles will not work!\n\n");
}
}
}
}
if OS != "Windows" && sym(config["history"]) != @none
{
io.eprint("Testing history...\n");
flags: []str = @[
DEFOPT +~ "BC_ENABLE_HISTORY=1",
DEFOPT +~ "BC_ENABLED=" +~ BC_ENABLED,
DEFOPT +~ "DC_ENABLED=" +~ DC_ENABLED,
DEFOPT +~ "BC_ENABLE_NLS=" +~ NLS_ENABLED,
DEFOPT +~ "BC_ENABLE_LIBRARY=0",
DEFOPT +~ "BC_ENABLE_AFL=0",
DEFOPT +~ "BC_ENABLE_EDITLINE=" +~ EDITLINE_ENABLED,
DEFOPT +~ "BC_ENABLE_READLINE=" +~ READLINE_ENABLED,
DEFOPT +~ "BC_ENABLE_EXTRA_MATH=" +~ EXTRA_MATH_ENABLED,
DEFOPT +~ "BC_ENABLE_OSSFUZZ=0",
DEFOPT +~ "_POSIX_C_SOURCE=200809L",
DEFOPT +~ "_XOPEN_SOURCE=700",
INCOPT,
];
res := $ $CC %(flags) -c @(path.join(src_dir, "src/history.c")) -E;
if res.exitcode != 0
{
if FORCE
{
io.eprint("Forcing history...\n");
}
else
{
error("History does not work\n");
}
}
else
{
if path.isfile("history.o")
{
path.rm("history.o");
}
io.eprint("History works.\n\n");
}
}
}
freebsd_flags: []str =
if OS != "FreeBSD"
{
@[ DEFOPT +~ "_POSIX_C_SOURCE=200809L", DEFOPT +~ "_XOPEN_SOURCE=700" ];
};
macos: bool = (OS == "Darwin");
macos_flags: []str =
if macos
{
@[ DEFOPT +~ "_DARWIN_C_SOURCE" ];
};
openbsd_flags: []str =
if OS == "OpenBSD"
{
if READLINE_ENABLED != "0"
{
error("Cannot use readline on OpenBSD");
}
@[ DEFOPT +~ "_BSD_SOURCE" ];
};
strip_flag: []str =
if OS != "Windows" && !bool(config["debug"]) && !macos && bool(config["strip"])
{
@[ "-s" ];
};
lto_flag: []str =
if bool(config["lto"])
{
@[ "-flto" ];
};
strict_flags: []str =
if bool(config["strict"])
{
// Strict build only works for GCC and Clang, so we do want to set that
// here.
if CC contains "gcc" || CC contains "clang"
{
// These are the standard strict build flags for both compilers.
std_strict: []str = @[ "-Wall", "-Wextra", "-Werror", "-pedantic" ];
// Clang has -Weverything, which I ensure Yc builds under.
//
// I also want unlimited errors because Clang is my development
// compiler; it caps at 20 by default.
compiler_strict: []str =
if CC contains "clang"
{
// Oh, and add the standard.
@[ "-Weverything", "-ferror-limit=100000", "-Wno-padded",
"-Wno-unknown-warning-option", "-Wno-unsafe-buffer-usage",
"-Wno-documentation-unknown-command", "-Wno-pre-c11-compat",
"-Wno-enum-enum-conversion", "-Wno-switch-default" ];
};
// Return the combination of the sets.
std_strict +~ compiler_strict;
}
else if OS == "Windows"
{
// Return the combo of the strict options, the standard, and the
// sanitizer defines.
@[ "/W4", "/WX", "/wd\"4996\"", "/permissive-" ];
}
};
version_contents: str = io.read_file(path.join(src_dir, "VERSION.txt"));
version_lines: []str = version_contents.split("\n");
version: str = version_lines[0];
version_flag: []str = @[ DEFOPT +~ "VERSION=" +~ version ];
other_flags: []str = freebsd_flags +~ macos_flags +~ openbsd_flags +~
lto_flag +~ strict_flags +~ version_flag +~
if bool(config["debug"])
{
@[ compiler_db["opt.debug"] ];
};
history_files: []str =
if HISTORY != @none
{
HISTORY_C_FILES;
};
c_files: []str =
if BUILD_MODE == @both
{
COMMON_C_FILES +~ EXEC_C_FILES +~ BC_C_FILES +~ DC_C_FILES +~ history_files;
}
else if BUILD_MODE == @bc
{
COMMON_C_FILES +~ EXEC_C_FILES +~ BC_C_FILES +~ history_files;
}
else if BUILD_MODE == @dc
{
COMMON_C_FILES +~ EXEC_C_FILES +~ DC_C_FILES +~ history_files;
}
else
{
COMMON_C_FILES +~ LIBRARY_C_FILES;
};
build_config: Gaml = @(gaml){
other_cflags: $other_flags
strip_flag: $strip_flag
};
targets: []str =
push build_config: config_stack
{
gen_o_files: []str =
if BUILD_MODE != @library
{
@[
txt2o("gen/lib.bc", "bc_lib", "bc_lib_name", "BC_ENABLED", true),
txt2o("gen/lib2.bc", "bc_lib2", "bc_lib2_name",
"BC_ENABLED && BC_ENABLE_EXTRA_MATH", true),
txt2o("gen/bc_help.txt", "bc_help", "", "BC_ENABLED", false),
txt2o("gen/dc_help.txt", "dc_help", "", "DC_ENABLED", false),
];
};
obj_files: []str = gen_o_files +~
for f: c_files
{
c2o(f);
};
if BUILD_MODE == @both || BUILD_MODE == @bc
{
if OS != "Windows" && bool(config["install_manpages"])
{
src: str = path.join("manuals/bc", BUILD_TYPE +~ ".1");
target BC_MANPAGE: src
{
$ cp -f @(file_dep) @(tgt);
}
}
exe(BC_BIN, obj_files);
}
if BUILD_MODE == @both || BUILD_MODE == @dc
{
if OS != "Windows" && bool(config["install_manpages"])
{
src: str = path.join("manuals/dc", BUILD_TYPE +~ ".1");
target DC_MANPAGE: src
{
$ cp -f @(file_dep) @(tgt);
}
}
if BUILD_MODE == @both
{
ln(DC_BIN, BC_BIN);
}
else
{
exe(DC_BIN, obj_files);
}
}
if BUILD_MODE == @library
{
lib(LIBRARY, obj_files);
}
if BUILD_MODE == @both
{
@[ BC_BIN, DC_BIN ];
}
else if BUILD_MODE == @bc
{
@[ DC_BIN ];
}
else if BUILD_MODE == @dc
{
@[ DC_BIN ];
}
else
{
includedir: str = get_includedir();
libdir: str = get_libdir();
pc_config: Gaml = @(gaml){
INCLUDEDIR: $includedir
LIBDIR: $libdir
VERSION: $version
};
push pc_config: config_stack
{
target PC_FILE: PC_FILE +~ ".in"
{
configure_file(file_dep, tgt, "%%");
}
}
@[ LIBRARY, PC_FILE ];
}
};
if OS != "Windows"
{
if LIBRARY_ENABLED == "0"
{
target @install: targets
{
bindir: str = get_bindir();
if BC_ENABLED != "0"
{
$ $SAFE_INSTALL $EXEC_INSTALL_MODE $BC_BIN
@(path.join(bindir, BC_BIN));
}
if DC_ENABLED != "0"
{
if BC_ENABLED != "0"
{
$ ln -sf @("./" +~ BC_BIN) @(path.join(bindir, DC_BIN));
}
else
{
$ $SAFE_INSTALL $EXEC_INSTALL_MODE $BC_BIN
@(path.join(bindir, BC_BIN));
}
}
if NLS_ENABLED != "0"
{
locale_install_args: []str =
if sym(config["locales"]) == @all
{
@[ "-l" ];
};
if DESTDIR != ""
{
$ @(path.join(src_dir, "scripts/locale_install.sh"))
%(locale_install_args) @(str(config["nlspath"]))
$MAINEXEC $DESTDIR;
}
else
{
$ @(path.join(src_dir, "scripts/locale_install.sh"))
%(locale_install_args) @(str(config["nlspath"]))
$MAINEXEC;
}
}
if bool(config["install_manpages"])
{
man1dir: str = get_man1dir();
if BC_ENABLED != "0"
{
$ rm -rf @(path.join(man1dir, BC_MANPAGE));
}
if DC_ENABLED != "0"
{
$ rm -rf @(path.join(man1dir, DC_MANPAGE));
}
}
}
target @uninstall
{
bindir: str = get_bindir();
if BC_ENABLED != "0"
{
$ rm -rf @(path.join(bindir, BC_BIN));
}
if DC_ENABLED != "0"
{
$ rm -rf @(path.join(bindir, DC_BIN));
}
if NLS_ENABLED != "0"
{
if DESTDIR != ""
{
$ @(path.join(src_dir, "scripts/locale_uninstall.sh"))
@(str(config["nlspath"])) $MAINEXEC $DESTDIR;
}
else
{
$ @(path.join(src_dir, "scripts/locale_uninstall.sh"))
@(str(config["nlspath"])) $MAINEXEC;
}
}
if bool(config["install_manpages"])
{
man1dir: str = get_man1dir();
$ rm -rf @(path.join(man1dir, BC_MANPAGE))
@(path.join(man1dir, DC_MANPAGE));
}
}
}
else
{
target @install: targets, BCL_HEADER_PATH
{
full_libdir: str = get_libdir();
$ $SAFE_INSTALL $EXEC_INSTALL_MODE @(file_dep)
@(path.join(full_libdir, file_dep));
full_pc_path: str = get_pc_path();
bcl_pc: str = file_deps[1];
$ $SAFE_INSTALL $MANPAGE_INSTALL_MODE $bcl_pc
@(path.join(full_pc_path, bcl_pc));
full_includedir: str = get_includedir();
$ $SAFE_INSTALL $MANPAGE_INSTALL_MODE @(file_deps[2])
@(path.join(full_includedir, BCL_HEADER));
if bool(config["install_manpages"])
{
$ $SAFE_INSTALL $MANPAGE_INSTALL_MODE
@(path.join(src_dir, path.join("manuals", BCL_MANPAGE)))
@(path.join(get_man3dir(), BCL_MANPAGE));
}
}
target @uninstall
{
$ rm -rf @(path.join(get_libdir(), LIBRARY))
@(path.join(get_pc_path(), PC_FILE))
@(path.join(get_includedir(), BCL_HEADER));
if bool(config["install_manpages"])
{
$ rm -rf @(path.join(get_man3dir(), BCL_MANPAGE));
}
}
}
}
// If the platform matches the host, we can run the test suite.
if platform == host
{
// If we have the library, build and run that test.
if BUILD_MODE == @library
{
libtesto: str = c2o("tests/bcl.c");
libtest: str = "bcl";
exe(libtest, @[ libtesto, targets[0] ]);
test @bcl: libtest
{
$ @(str(tgt_name));
}
}
else
{
if BUILD_MODE != @dc
{
exe_tests("bc");
}
if BUILD_MODE != @bc
{
exe_tests("dc");
}
target @clean_tests
{
for f: path.find_ext(build_dir, "txt")
{
path.rm(f);
}
}
}
}
target "bitfuncgen"
{
error("TODO: Make this");
}
target @bitfuncgen: "bitfuncgen"
{
error("TODO: Make this");
}
target "ministat"
{
error("TODO: Make this");
}
target @ministat: "ministat"
{
error("TODO: Make this");
}
target @all: targets;

View file

@ -1,6 +1,9 @@
-Weverything
-pedantic
-Wno-unsafe-buffer-usage
-Wno-pre-c11-compat
-Wno-unknown-warning-option
-Wno-switch-default
-D_POSIX_C_SOURCE=200809L
-D_XOPEN_SOURCE=700
-D_BSD_SOURCE

View file

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2024 Gavin D. Howard and contributors.
# Copyright (c) 2018-2025 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:
@ -55,7 +55,7 @@ usage() {
printf ' %s [-a|-bD|-dB|-c] [-CeEfgGHilmMNPrtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\\\n' "$script"
printf ' [-s SETTING] [-S SETTING] [-p TYPE]\n'
printf ' %s \\\n' "$script"
printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n'
printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc] \\\n'
printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n'
printf ' [--disable-history --disable-man-pages --disable-nls --disable-strip] \\\n'
printf ' [--enable-editline] [--enable-readline] [--enable-internal-history] \\\n'
@ -74,7 +74,7 @@ usage() {
printf '\n'
printf ' -a, --library\n'
printf ' Build the libbcl instead of the programs. This is meant to be used with\n'
printf ' Other software like programming languages that want to make use of the\n'
printf ' other software like programming languages that want to make use of the\n'
printf ' parsing and math capabilities. This option will install headers using\n'
printf ' `make install`.\n'
printf ' -b, --bc-only\n'
@ -83,10 +83,6 @@ usage() {
printf ' -B, --disable-bc\n'
printf ' Disable bc. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n'
printf ' are specified too.\n'
printf ' -c, --coverage\n'
printf ' Generate test coverage code. Requires gcov and gcovr.\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'
@ -133,8 +129,6 @@ 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'
@ -172,17 +166,9 @@ usage() {
printf ' Set the default named by SETTING to off. See below for possible values\n'
printf ' for SETTING. For multiple instances of the -s or -S for the the same\n'
printf ' setting, the last one is used.\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 ' -Z, --enable-ossfuzz-mode\n'
printf ' Enable fuzzing mode for OSS-Fuzz. 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'
@ -254,12 +240,12 @@ usage() {
printf ' path (or contain one). This is treated the same as the POSIX\n'
printf ' definition of $NLSPATH (see POSIX environment variables for\n'
printf ' more information). Default is "/usr/share/locale/%%L/%%N".\n'
printf ' PC_PATH The location to install pkg-config files to. Must be an\n'
printf ' PC_PATH The location to install pkg-config files to. Must be a\n'
printf ' path or contain one. Default is the first path given by the\n'
printf ' output of `pkg-config --variable=pc_path pkg-config`.\n'
printf ' EXECSUFFIX The suffix to append to the executable names, used to not\n'
printf ' interfere with other installed bc executables. Default is "".\n'
printf ' EXECPREFIX The prefix to append to the executable names, used to not\n'
printf ' EXECPREFIX The prefix to prepend to the executable names, used to not\n'
printf ' interfere with other installed bc executables. Default is "".\n'
printf ' DESTDIR For package creation. Default is "". If it is empty when\n'
printf ' `%s` is run, it can also be passed to `make install`\n' "$script"
@ -482,7 +468,7 @@ find_src_files() {
}
# This function generates a list of files to go into the Makefile. It generates
# the list of object files, as well as the list of test coverage files.
# the list of object files.
#
# @param contents The contents of the Makefile template to put the list of
# files into.
@ -503,8 +489,6 @@ gen_file_list() {
_gen_file_list_needle_src="SRC"
_gen_file_list_needle_obj="OBJ"
_gen_file_list_needle_gcda="GCDA"
_gen_file_list_needle_gcno="GCNO"
_gen_file_list_replacement=$(find_src_files $_gen_file_list_unneeded | tr '\n' ' ')
_gen_file_list_contents=$(replace "$_gen_file_list_contents" \
@ -521,151 +505,9 @@ gen_file_list() {
_gen_file_list_contents=$(replace "$_gen_file_list_contents" \
"$_gen_file_list_needle_obj" "$_gen_file_list_replacement")
_gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "o" "gcda")
_gen_file_list_contents=$(replace "$_gen_file_list_contents" \
"$_gen_file_list_needle_gcda" "$_gen_file_list_replacement")
_gen_file_list_replacement=$(replace_exts "$_gen_file_list_replacement" "gcda" "gcno")
_gen_file_list_contents=$(replace "$_gen_file_list_contents" \
"$_gen_file_list_needle_gcno" "$_gen_file_list_replacement")
printf '%s\n' "$_gen_file_list_contents"
}
# Generates the proper test targets for each test to have its own target. This
# allows `make test` to run in parallel.
#
# @param name Which calculator to generate tests for.
# @param extra_math An integer that, if non-zero, activates extra math tests.
# @param time_tests An integer that, if non-zero, tells the test suite to time
# the execution of each test.
gen_std_tests() {
_gen_std_tests_name="$1"
shift
_gen_std_tests_extra_math="$1"
shift
_gen_std_tests_time_tests="$1"
shift
_gen_std_tests_extra_required=$(cat "$scriptdir/tests/extra_required.txt")
for _gen_std_tests_t in $(cat "$scriptdir/tests/$_gen_std_tests_name/all.txt"); do
if [ "$_gen_std_tests_extra_math" -eq 0 ]; then
if [ -z "${_gen_std_tests_extra_required##*$_gen_std_tests_t*}" ]; then
printf 'test_%s_%s:\n\t@printf "Skipping %s %s\\n"\n\n' \
"$_gen_std_tests_name" "$_gen_std_tests_t" "$_gen_std_tests_name" \
"$_gen_std_tests_t" >> "Makefile"
continue
fi
fi
printf 'test_%s_%s:\n\t@export BC_TEST_OUTPUT_DIR="%s/tests"; sh $(TESTSDIR)/test.sh %s %s %s %s %s\n\n' \
"$_gen_std_tests_name" "$_gen_std_tests_t" "$builddir" "$_gen_std_tests_name" \
"$_gen_std_tests_t" "$generate_tests" "$time_tests" \
"$*" >> "Makefile"
done
}
# Generates a list of test targets that will be used as prerequisites for other
# targets.
#
# @param name The name of the calculator to generate test targets for.
gen_std_test_targets() {
_gen_std_test_targets_name="$1"
shift
_gen_std_test_targets_tests=$(cat "$scriptdir/tests/${_gen_std_test_targets_name}/all.txt")
for _gen_std_test_targets_t in $_gen_std_test_targets_tests; do
printf ' test_%s_%s' "$_gen_std_test_targets_name" "$_gen_std_test_targets_t"
done
printf '\n'
}
# Generates the proper test targets for each error test to have its own target.
# This allows `make test_bc_errors` and `make test_dc_errors` to run in
# parallel.
#
# @param name Which calculator to generate tests for.
gen_err_tests() {
_gen_err_tests_name="$1"
shift
_gen_err_tests_fs=$(ls "$scriptdir/tests/$_gen_err_tests_name/errors/")
for _gen_err_tests_t in $_gen_err_tests_fs; do
printf 'test_%s_error_%s:\n\t@export BC_TEST_OUTPUT_DIR="%s/tests"; sh $(TESTSDIR)/error.sh %s %s %s %s\n\n' \
"$_gen_err_tests_name" "$_gen_err_tests_t" "$builddir" "$_gen_err_tests_name" \
"$_gen_err_tests_t" "$problematic_tests" "$*" >> "Makefile"
done
}
# Generates a list of error test targets that will be used as prerequisites for
# other targets.
#
# @param name The name of the calculator to generate test targets for.
gen_err_test_targets() {
_gen_err_test_targets_name="$1"
shift
_gen_err_test_targets_tests=$(ls "$scriptdir/tests/$_gen_err_test_targets_name/errors/")
for _gen_err_test_targets_t in $_gen_err_test_targets_tests; do
printf ' test_%s_error_%s' "$_gen_err_test_targets_name" "$_gen_err_test_targets_t"
done
printf '\n'
}
# Generates the proper script test targets for each script test to have its own
# target. This allows `make test` to run in parallel.
#
# @param name Which calculator to generate tests for.
# @param extra_math An integer that, if non-zero, activates extra math tests.
# @param generate An integer that, if non-zero, activates generated tests.
# @param time_tests An integer that, if non-zero, tells the test suite to time
# the execution of each test.
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@export BC_TEST_OUTPUT_DIR="%s/tests"; sh $(TESTSDIR)/script.sh %s %s %s 1 %s %s %s\n\n' \
"$_gen_script_tests_name" "$_gen_script_tests_b" "$builddir" "$_gen_script_tests_name" \
"$_gen_script_tests_f" "$_gen_script_tests_extra_math" "$_gen_script_tests_generate" \
"$_gen_script_tests_time" "$*" >> "Makefile"
done
}
set_default() {
_set_default_on="$1"
@ -710,7 +552,6 @@ predefined_build() {
BSD)
bc_only=0
dc_only=0
coverage=0
debug=0
optimization="3"
hist=1
@ -723,11 +564,6 @@ predefined_build() {
strip_bin=1
all_locales=0
library=0
fuzz=0
ossfuzz=0
time_tests=0
vg=0
memcheck=0
clean=1
bc_default_banner=0
bc_default_sigint_reset=1
@ -744,7 +580,6 @@ predefined_build() {
GNU)
bc_only=0
dc_only=0
coverage=0
debug=0
optimization="3"
hist=1
@ -757,11 +592,6 @@ predefined_build() {
strip_bin=1
all_locales=0
library=0
fuzz=0
ossfuzz=0
time_tests=0
vg=0
memcheck=0
clean=1
bc_default_banner=1
bc_default_sigint_reset=1
@ -777,10 +607,10 @@ predefined_build() {
GDH)
CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories"
CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11"
CFLAGS="$CFLAGS -Wno-unknown-warning-option -Wno-switch-default -Wno-pre-c11-compat"
CFLAGS="$CFLAGS -Werror -pedantic -std=c11"
bc_only=0
dc_only=0
coverage=0
debug=0
optimization="3"
hist=1
@ -793,11 +623,6 @@ predefined_build() {
strip_bin=1
all_locales=0
library=0
fuzz=0
ossfuzz=0
time_tests=0
vg=0
memcheck=0
clean=1
bc_default_banner=1
bc_default_sigint_reset=1
@ -813,10 +638,10 @@ predefined_build() {
DBG)
CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories"
CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11"
CFLAGS="$CFLAGS -Wno-unknown-warning-option -Wno-switch-default -Wno-pre-c11-compat"
CFLAGS="$CFLAGS -Werror -pedantic -std=c11"
bc_only=0
dc_only=0
coverage=0
debug=1
optimization="0"
hist=1
@ -829,11 +654,6 @@ predefined_build() {
strip_bin=1
all_locales=0
library=0
fuzz=0
ossfuzz=0
time_tests=0
vg=0
memcheck=1
clean=1
bc_default_banner=1
bc_default_sigint_reset=1
@ -852,36 +672,12 @@ predefined_build() {
esac
}
# Generates a list of script test targets that will be used as prerequisites for
# other targets.
#
# @param name The name of the calculator to generate script test targets for.
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'
}
# This is a list of defaults, but it is also the list of possible options for
# users to change.
#
# The development options are: force (force options even if they fail), valgrind
# (build in a way suitable for valgrind testing), memcheck (same as valgrind),
# and fuzzing (build in a way suitable for fuzzing).
# The development options are: force (force options even if they fail).
bc_only=0
dc_only=0
coverage=0
karatsuba_len=32
debug=0
hist=1
@ -895,11 +691,6 @@ force=0
strip_bin=1
all_locales=0
library=0
fuzz=0
ossfuzz=0
time_tests=0
vg=0
memcheck=0
clean=1
problematic_tests=1
@ -920,13 +711,12 @@ dc_default_digit_clamp=0
# getopts is a POSIX utility, but it cannot handle long options. Thus, the
# handling of long options is done by hand, and that's the reason that short and
# long options cannot be mixed.
while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do
while getopts "abBcdDeEfgGhHik:lMNO:p:PrS:s:T-" 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 ;;
@ -940,7 +730,6 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do
i) hist_impl="internal" ;;
k) karatsuba_len="$OPTARG" ;;
l) all_locales=1 ;;
m) memcheck=1 ;;
M) install_manpages=0 ;;
N) nls=0 ;;
O) optimization="$OPTARG" ;;
@ -949,11 +738,7 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do
r) hist_impl="readline" ;;
S) set_default 0 "$OPTARG" ;;
s) set_default 1 "$OPTARG" ;;
t) time_tests=1 ;;
T) strip_bin=0 ;;
v) vg=1 ;;
z) fuzz=1 ;;
Z) ossfuzz=1 ;;
-)
arg="$1"
arg="${arg#--}"
@ -963,7 +748,6 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do
library) library=1 ;;
bc-only) bc_only=1 ;;
dc-only) dc_only=1 ;;
coverage) coverage=1 ;;
debug) debug=1 ;;
force) force=1 ;;
prefix=?*) PREFIX="$LONG_OPTARG" ;;
@ -1077,27 +861,20 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do
enable-editline) hist_impl="editline" ;;
enable-readline) hist_impl="readline" ;;
enable-internal-history) hist_impl="internal" ;;
enable-test-timing) time_tests=1 ;;
enable-valgrind) vg=1 ;;
enable-fuzz-mode) fuzz=1 ;;
enable-ossfuzz-mode) ossfuzz=1 ;;
enable-memcheck) memcheck=1 ;;
install-all-locales) all_locales=1 ;;
help* | bc-only* | dc-only* | coverage* | debug*)
help* | bc-only* | dc-only* | debug*)
usage "No arg allowed for --$arg option" ;;
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*)
disable-history*)
usage "No arg allowed for --$arg option" ;;
disable-man-pages* | disable-nls* | disable-strip*)
usage "No arg allowed for --$arg option" ;;
disable-problematic-tests*)
usage "No arg allowed for --$arg option" ;;
enable-fuzz-mode* | enable-test-timing* | enable-valgrind*)
usage "No arg allowed for --$arg option" ;;
enable-memcheck* | install-all-locales*)
install-all-locales*)
usage "No arg allowed for --$arg option" ;;
enable-editline* | enable-readline*)
usage "No arg allowed for --$arg option" ;;
@ -1221,33 +998,7 @@ link="@printf 'No link necessary\\\\n'"
main_exec="BC"
executable="BC_EXEC"
tests="test_bc timeconst test_dc"
bc_test="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh bc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(BC_EXEC)"
bc_test_np="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh -n bc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(BC_EXEC)"
dc_test="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh dc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(DC_EXEC)"
dc_test_np="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh -n dc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(DC_EXEC)"
timeconst="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/bc/timeconst.sh \$(TESTSDIR)/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 [ "$vg" -ne 0 ]; then
debug=1
bc_test_exec='valgrind $(VALGRIND_ARGS) $(BC_EXEC)'
dc_test_exec='valgrind $(VALGRIND_ARGS) $(DC_EXEC)'
bcl_test_exec='valgrind $(VALGRIND_ARGS) $(BCL_TEST)'
else
bc_test_exec='$(BC_EXEC)'
dc_test_exec='$(DC_EXEC)'
bcl_test_exec='$(BCL_TEST)'
fi
test_bc_history_prereqs="test_bc_history_all"
test_dc_history_prereqs="test_dc_history_all"
karatsuba="@printf 'karatsuba cannot be run because one of bc or dc is not built\\\\n'"
karatsuba_test="@printf 'karatsuba cannot be run because one of bc or dc is not built\\\\n'"
bc_lib="\$(GEN_DIR)/lib.o"
bc_help="\$(GEN_DIR)/bc_help.o"
@ -1274,9 +1025,6 @@ if [ "$library" -ne 0 ]; then
default_target_prereqs="\$(BIN) \$(OBJ)"
default_target_cmd="ar -r -cu \$(LIBBC) \$(OBJ)"
default_target="\$(LIBBC)"
tests="test_library"
test_bc_history_prereqs=" test_bc_history_skip"
test_dc_history_prereqs=" test_dc_history_skip"
install_prereqs=" install_library"
uninstall_prereqs=" uninstall_library"
@ -1292,10 +1040,6 @@ elif [ "$bc_only" -eq 1 ]; then
executables="bc"
dc_test="@printf 'No dc tests to run\\\\n'"
dc_test_np="@printf 'No dc tests to run\\\\n'"
test_dc_history_prereqs=" test_dc_history_skip"
install_prereqs=" install_execs"
install_man_prereqs=" install_bc_manpage"
uninstall_prereqs=" uninstall_bc"
@ -1303,7 +1047,6 @@ elif [ "$bc_only" -eq 1 ]; then
default_target="\$(BC_EXEC)"
second_target="\$(DC_EXEC)"
tests="test_bc timeconst"
elif [ "$dc_only" -eq 1 ]; then
@ -1318,58 +1061,11 @@ elif [ "$dc_only" -eq 1 ]; then
main_exec="DC"
executable="DC_EXEC"
bc_test="@printf 'No bc tests to run\\\\n'"
bc_test_np="@printf 'No bc tests to run\\\\n'"
test_bc_history_prereqs=" test_bc_history_skip"
timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'"
install_prereqs=" install_execs"
install_man_prereqs=" install_dc_manpage"
uninstall_prereqs=" uninstall_dc"
uninstall_man_prereqs=" uninstall_dc_manpage"
tests="test_dc"
elif [ "$ossfuzz" -eq 1 ]; then
if [ "$bc_only" -ne 0 ] || [ "$dc_only" -ne 0 ]; then
usage "An OSS-Fuzz build must build both fuzzers."
fi
bc=1
dc=1
# Expressions *cannot* exit in an OSS-Fuzz build.
bc_default_expr_exit=0
dc_default_expr_exit=0
executables="bc_fuzzer and dc_fuzzer"
karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)"
karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)"
if [ "$library" -eq 0 ]; then
install_prereqs=" install_execs"
install_man_prereqs=" install_bc_manpage install_dc_manpage"
uninstall_prereqs=" uninstall_bc uninstall_dc"
uninstall_man_prereqs=" uninstall_bc_manpage uninstall_dc_manpage"
else
install_prereqs=" install_library install_bcl_header"
install_man_prereqs=" install_bcl_manpage"
uninstall_prereqs=" uninstall_library uninstall_bcl_header"
uninstall_man_prereqs=" uninstall_bcl_manpage"
tests="test_library"
fi
second_target_prereqs="src/bc_fuzzer.o $default_target_prereqs"
default_target_prereqs="\$(BC_FUZZER) src/dc_fuzzer.o $default_target_prereqs"
default_target_cmd="\$(CXX) \$(CFLAGS) src/dc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(DC_FUZZER) \&\& ln -sf ./dc_fuzzer_c \$(DC_FUZZER_C)"
second_target_cmd="\$(CXX) \$(CFLAGS) src/bc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(BC_FUZZER) \&\& ln -sf ./bc_fuzzer_c \$(BC_FUZZER_C)"
default_target="\$(DC_FUZZER) \$(DC_FUZZER_C)"
second_target="\$(BC_FUZZER) \$(BC_FUZZER_C)"
else
bc=1
@ -1378,7 +1074,6 @@ else
executables="bc and dc"
karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)"
karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)"
if [ "$library" -eq 0 ]; then
install_prereqs=" install_execs"
@ -1390,7 +1085,6 @@ else
install_man_prereqs=" install_bcl_manpage"
uninstall_prereqs=" uninstall_library uninstall_bcl_header"
uninstall_man_prereqs=" uninstall_bcl_manpage"
tests="test_library"
fi
second_target_prereqs="$default_target_prereqs"
@ -1399,18 +1093,6 @@ else
fi
if [ "$fuzz" -ne 0 ] && [ "$ossfuzz" -ne 0 ]; then
usage "Fuzzing mode and OSS-Fuzz mode are mutually exclusive"
fi
# We need specific stuff for fuzzing.
if [ "$fuzz" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then
debug=1
hist=0
nls=0
optimization="3"
fi
# This sets some necessary things for debug mode.
if [ "$debug" -eq 1 ]; then
@ -1429,26 +1111,6 @@ if [ -n "$optimization" ]; then
CFLAGS="-O$optimization $CFLAGS"
fi
# Set test coverage defaults.
if [ "$coverage" -eq 1 ]; then
if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then
usage "Can only specify -c without -b or -d"
fi
CFLAGS="-fprofile-arcs -ftest-coverage -g -O0 $CFLAGS"
CPPFLAGS="-DNDEBUG $CPPFLAGS"
COVERAGE_OUTPUT="@gcov -pabcdf \$(GCDA) \$(BC_GCDA) \$(DC_GCDA) \$(HISTORY_GCDA) \$(RAND_GCDA)"
COVERAGE_OUTPUT="$COVERAGE_OUTPUT;\$(RM) -f \$(GEN)*.gc*"
COVERAGE_OUTPUT="$COVERAGE_OUTPUT;gcovr --exclude-unreachable-branches --exclude-throw-branches --html-details --output index.html"
COVERAGE_PREREQS=" test coverage_output"
else
COVERAGE_OUTPUT="@printf 'Coverage not generated\\\\n'"
COVERAGE_PREREQS=""
fi
# Set some defaults.
if [ -z "${DESTDIR+set}" ]; then
destdir=""
@ -1567,7 +1229,7 @@ if [ "$nls" -ne 0 ]; then
printf 'NLS works.\n\n'
printf 'Testing gencat...\n'
gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null
gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" 2>&1
err="$?"
@ -1672,26 +1334,10 @@ else
fi
# We have to disable the history tests if it is disabled or valgrind is on. Or
# if we are using editline or readline.
if [ "$hist" -eq 0 ] || [ "$vg" -ne 0 ]; then
test_bc_history_prereqs=" test_bc_history_skip"
test_dc_history_prereqs=" test_dc_history_skip"
history_tests="@printf 'Skipping history tests...\\\\n'"
if [ "$hist" -eq 0 ]; then
CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0"
else
if [ "$editline" -eq 0 ] && [ "$readline" -eq 0 ]; then
history_tests="@printf '\$(TEST_STARS)\\\\n\\\\nRunning history tests...\\\\n\\\\n'"
history_tests="$history_tests \&\& \$(TESTSDIR)/history.sh bc -a \&\&"
history_tests="$history_tests \$(TESTSDIR)/history.sh dc -a \&\& printf"
history_tests="$history_tests '\\\\nAll history tests passed.\\\\n\\\\n\$(TEST_STARS)\\\\n'"
else
test_bc_history_prereqs=" test_bc_history_skip"
test_dc_history_prereqs=" test_dc_history_skip"
history_tests="@printf 'Skipping history tests...\\\\n'"
fi
# We are also setting the CFLAGS and LDFLAGS here.
if [ "$editline" -ne 0 ]; then
LDFLAGS="$LDFLAGS -ledit"
@ -1795,7 +1441,7 @@ GEN_DIR="$scriptdir/gen"
# `gen/strgen.sh` is used.
GEN="strgen"
GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -DBC_ENABLE_OSSFUZZ=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)"
CLEAN_PREREQS=" clean_gen clean_coverage"
CLEAN_PREREQS=" clean_gen"
if [ -z "${GEN_HOST+set}" ]; then
GEN_HOST=1
@ -1803,7 +1449,6 @@ else
if [ "$GEN_HOST" -eq 0 ]; then
GEN="strgen.sh"
GEN_EXEC_TARGET="@printf 'Do not need to build gen/strgen.c\\\\n'"
CLEAN_PREREQS=" clean_coverage"
fi
fi
@ -1848,9 +1493,7 @@ else
headers="$headers \$(DC_HEADERS)"
fi
# This convoluted mess does pull the version out. If you change the format of
# include/version.h, you may have to change this line.
version=$(cat "$scriptdir/include/version.h" | grep "VERSION " - | awk '{ print $3 }' -)
version=$(cat "$scriptdir/VERSION.txt" | head -n1)
if [ "$library" -ne 0 ]; then
@ -1880,14 +1523,6 @@ if [ "$library" -ne 0 ]; then
fi
elif [ "$ossfuzz" -ne 0 ]; then
unneeded="$unneeded library.c main.c"
PC_PATH=""
pkg_config_install=""
pkg_config_uninstall=""
else
unneeded="$unneeded library.c"
@ -1909,10 +1544,6 @@ if [ "$manpage_args" = "" ]; then
manpage_args="A"
fi
if [ "$vg" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then
memcheck=1
fi
if [ "$bc_default_prompt" = "" ]; then
bc_default_prompt="$bc_default_tty_mode"
fi
@ -1921,14 +1552,6 @@ if [ "$dc_default_prompt" = "" ]; then
dc_default_prompt="$dc_default_tty_mode"
fi
# Generate the test targets and prerequisites.
bc_tests=$(gen_std_test_targets bc)
bc_script_tests=$(gen_script_test_targets bc)
bc_err_tests=$(gen_err_test_targets bc)
dc_tests=$(gen_std_test_targets dc)
dc_script_tests=$(gen_script_test_targets dc)
dc_err_tests=$(gen_err_test_targets dc)
printf 'unneeded: %s\n' "$unneeded"
# Print out the values; this is for debugging.
@ -1949,7 +1572,6 @@ printf 'BC_ENABLE_LIBRARY=%s\n\n' "$library"
printf 'BC_ENABLE_HISTORY=%s\n' "$hist"
printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math"
printf 'BC_ENABLE_NLS=%s\n\n' "$nls"
printf 'BC_ENABLE_AFL=%s\n' "$fuzz"
printf '\n'
printf 'BC_NUM_KARATSUBA_LEN=%s\n' "$karatsuba_len"
printf '\n'
@ -2046,26 +1668,11 @@ contents=$(replace "$contents" "BUILDDIR" "$builddir")
contents=$(replace "$contents" "HEADERS" "$headers")
contents=$(replace "$contents" "VERSION" "$version")
contents=$(replace "$contents" "BC_ENABLED" "$bc")
contents=$(replace "$contents" "DC_ENABLED" "$dc")
contents=$(replace "$contents" "BC_ALL_TESTS" "$bc_test")
contents=$(replace "$contents" "BC_ALL_TESTS_NP" "$bc_test_np")
contents=$(replace "$contents" "BC_TESTS" "$bc_tests")
contents=$(replace "$contents" "BC_SCRIPT_TESTS" "$bc_script_tests")
contents=$(replace "$contents" "BC_ERROR_TESTS" "$bc_err_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_ALL_TESTS_NP" "$dc_test_np")
contents=$(replace "$contents" "DC_TESTS" "$dc_tests")
contents=$(replace "$contents" "DC_SCRIPT_TESTS" "$dc_script_tests")
contents=$(replace "$contents" "DC_ERROR_TESTS" "$dc_err_tests")
contents=$(replace "$contents" "DC_TEST_EXEC" "$dc_test_exec")
contents=$(replace "$contents" "BCL_TEST_EXEC" "$bcl_test_exec")
contents=$(replace "$contents" "BUILD_TYPE" "$manpage_args")
contents=$(replace "$contents" "EXCLUDE_EXTRA_MATH" "$exclude_extra_math")
@ -2073,10 +1680,6 @@ 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" "FUZZ" "$fuzz")
contents=$(replace "$contents" "OSSFUZZ" "$ossfuzz")
contents=$(replace "$contents" "MEMCHECK" "$memcheck")
contents=$(replace "$contents" "LIB_FUZZING_ENGINE" "$LIB_FUZZING_ENGINE")
contents=$(replace "$contents" "BC_LIB_O" "$bc_lib")
contents=$(replace "$contents" "BC_HELP_O" "$bc_help")
@ -2099,8 +1702,6 @@ contents=$(replace "$contents" "CPPFLAGS" "$CPPFLAGS")
contents=$(replace "$contents" "LDFLAGS" "$LDFLAGS")
contents=$(replace "$contents" "CC" "$CC")
contents=$(replace "$contents" "HOSTCC" "$HOSTCC")
contents=$(replace "$contents" "COVERAGE_OUTPUT" "$COVERAGE_OUTPUT")
contents=$(replace "$contents" "COVERAGE_PREREQS" "$COVERAGE_PREREQS")
contents=$(replace "$contents" "INSTALL_PREREQS" "$install_prereqs")
contents=$(replace "$contents" "INSTALL_MAN_PREREQS" "$install_man_prereqs")
contents=$(replace "$contents" "INSTALL_LOCALES" "$install_locales")
@ -2126,22 +1727,14 @@ 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" "GENERATE_TESTS" "$generate_tests")
contents=$(replace "$contents" "PROBLEMATIC_TESTS" "$problematic_tests")
contents=$(replace "$contents" "EXECUTABLES" "$executables")
contents=$(replace "$contents" "MAIN_EXEC" "$main_exec")
contents=$(replace "$contents" "EXEC" "$executable")
contents=$(replace "$contents" "TESTS" "$tests")
contents=$(replace "$contents" "BC_HISTORY_TEST_PREREQS" "$test_bc_history_prereqs")
contents=$(replace "$contents" "DC_HISTORY_TEST_PREREQS" "$test_dc_history_prereqs")
contents=$(replace "$contents" "HISTORY_TESTS" "$history_tests")
contents=$(replace "$contents" "VG_BC_TEST" "$vg_bc_test")
contents=$(replace "$contents" "VG_DC_TEST" "$vg_dc_test")
contents=$(replace "$contents" "TIMECONST" "$timeconst")
contents=$(replace "$contents" "KARATSUBA" "$karatsuba")
contents=$(replace "$contents" "KARATSUBA_TEST" "$karatsuba_test")
contents=$(replace "$contents" "LONG_BIT_DEFINE" "$LONG_BIT_DEFINE")
@ -2169,28 +1762,6 @@ contents=$(replace "$contents" "DC_DEFAULT_DIGIT_CLAMP" "$dc_default_digit_clamp
# Do the first print to the Makefile.
printf '%s\n%s\n\n' "$contents" "$SRC_TARGETS" > "Makefile"
# Generate the individual test targets.
if [ "$bc" -ne 0 ]; then
gen_std_tests bc "$extra_math" "$time_tests" $bc_test_exec
gen_script_tests bc "$extra_math" "$generate_tests" "$time_tests" $bc_test_exec
gen_err_tests bc $bc_test_exec
fi
if [ "$dc" -ne 0 ]; then
gen_std_tests dc "$extra_math" "$time_tests" $dc_test_exec
gen_script_tests dc "$extra_math" "$generate_tests" "$time_tests" $dc_test_exec
gen_err_tests dc $dc_test_exec
fi
if [ "$ossfuzz" -ne 0 ]; then
printf 'bc_fuzzer_c: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_c\n' >> Makefile
printf 'bc_fuzzer_C: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_C\n' >> Makefile
printf 'dc_fuzzer_c: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_c\n' >> Makefile
printf 'dc_fuzzer_C: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_C\n' >> Makefile
fi
# Copy the correct manuals to the expected places.
mkdir -p manuals
cp -f "$scriptdir/manuals/bc/$manpage_args.1.md" manuals/bc.1.md

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -37,7 +37,7 @@ usage: %s [options] [file...]
bc is a command-line, arbitrary-precision calculator with a Turing-complete
language. For details, use `man %s` or see the online documentation at
https://git.gavinhoward.com/gavin/bc/src/tag/%s/manuals/bc/%s.1.md.
https://github.com/gavinhoward/bc/tree/%s/manuals/bc/%s.1.md .
This bc is compatible with both the GNU bc and the POSIX bc spec. See the GNU bc
manual (https://www.gnu.org/software/bc/manual/bc.html) and bc spec

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -37,7 +37,7 @@ usage: %s [options] [file...]
dc is a reverse-polish notation command-line calculator which supports unlimited
precision arithmetic. For details, use `man %s` or see the online documentation
at https://git.gavinhoward.com/gavin/bc/src/tag/%s/manuals/bc/%s.1.md.
at https://github.com/gavinhoward/bc/tree/%s/manuals/dc/%s.1.md .
This dc is (mostly) compatible with the OpenBSD dc and the GNU dc. See the
OpenBSD man page (http://man.openbsd.org/OpenBSD-current/man1/dc.1) and the GNU

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -444,108 +444,77 @@ define void uint64(x){uintn(x,8)}
define void int64(x){intn(x,8)}
define void uint(x){uintn(x,ubytes(x))}
define void int(x){intn(x,sbytes(x))}
define bunrev(t){
auto a,s,m[]
s=scale
scale=0
t=abs(t)$
while(t!=1){
t=divmod(t,2,m[])
a*=2
a+=m[0]
}
scale=s
return a
}
define band(a,b){
auto s,t,m[],n[]
auto r,p,s,m[]
a=abs(a)$
b=abs(b)$
if(b>a){
t=b
b=a
a=t
}
r=0
p=1
s=scale
scale=0
t=1
while(b){
while(a&&b) {
a=divmod(a,2,m[])
b=divmod(b,2,n[])
t*=2
t+=(m[0]&&n[0])
if(m[0]){
b=divmod(b,2,m[])
if(m[0])r+=p
}else b/=2
p*=2
}
scale=s
return bunrev(t)
return r
}
define bor(a,b){
auto s,t,m[],n[]
auto r,p,s,m[]
a=abs(a)$
b=abs(b)$
if(b>a){
t=b
b=a
a=t
}
r=0
p=1
s=scale
scale=0
t=1
while(b){
while(a||b){
a=divmod(a,2,m[])
b=divmod(b,2,n[])
t*=2
t+=(m[0]||n[0])
}
while(a){
a=divmod(a,2,m[])
t*=2
t+=m[0]
if(!m[0])b=divmod(b,2,m[])
else b/=2
if(m[0])r+=p
p*=2
}
scale=s
return bunrev(t)
return r
}
define bxor(a,b){
auto s,t,m[],n[]
auto r,p,s,m[],n[]
a=abs(a)$
b=abs(b)$
if(b>a){
t=b
b=a
a=t
}
r=0
p=1
s=scale
scale=0
t=1
while(b){
while(a||b){
a=divmod(a,2,m[])
b=divmod(b,2,n[])
t*=2
t+=(m[0]+n[0]==1)
}
while(a){
a=divmod(a,2,m[])
t*=2
t+=m[0]
if(m[0]+n[0]==1)r+=p
p*=2
}
scale=s
return bunrev(t)
return r
}
define bshl(a,b){return abs(a)$*2^abs(b)$}
define bshr(a,b){return(abs(a)$/2^abs(b)$)$}
define bnotn(x,n){
auto s,t,m[]
auto r,p,s,t,m[]
s=scale
scale=0
t=2^(abs(n)$*8)
x=abs(x)$%t+t
t=1
r=2^(abs(n)$*8)
x=abs(x)$%r+r
r=0
p=1
while(x!=1){
x=divmod(x,2,m[])
t*=2
t+=!m[0]
if(!m[0])r+=p
p*=2
}
scale=s
return bunrev(t)
return r
}
define bnot8(x){return bnotn(x,1)}
define bnot16(x){return bnotn(x,2)}
@ -553,13 +522,19 @@ define bnot32(x){return bnotn(x,4)}
define bnot64(x){return bnotn(x,8)}
define bnot(x){return bnotn(x,ubytes(x))}
define brevn(x,n){
auto s,t,m[]
auto a,s,m[]
s=scale
scale=0
t=2^(abs(n)$*8)
x=abs(x)$%t+t
a=2^(abs(n)$*8)
x=abs(x)$%a+a
a=0
while(x!=1){
x=divmod(x,2,m[])
a*=2
a+=m[0]
}
scale=s
return bunrev(x)
return a
}
define brev8(x){return brevn(x,1)}
define brev16(x){return brevn(x,2)}

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -68,7 +68,7 @@ static const char* const bc_gen_ex_end = "{{ end }}";
// This is exactly what it looks like. It just slaps a simple license header on
// the generated C source file.
static const char* const bc_gen_header =
"// Copyright (c) 2018-2024 Gavin D. Howard and contributors.\n"
"// Copyright (c) 2018-2025 Gavin D. Howard and contributors.\n"
"// Licensed under the 2-clause BSD license.\n"
"// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n";
// clang-format on

View file

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2018-2024 Gavin D. Howard and contributors.
# Copyright (c) 2018-2025 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:
@ -96,7 +96,7 @@ if [ -n "$remove_tabs" ]; then
fi
cat<<EOF
// Copyright (c) 2018-2024 Gavin D. Howard and contributors.
// Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -265,9 +265,9 @@ bc_lex_token(BcLex* l);
* @return An expression entry for bc_parse_exprs[].
*/
#define BC_PARSE_EXPR_ENTRY(e1, e2, e3, e4, e5, e6, e7, e8) \
((UINTMAX_C(e1) << 7) | (UINTMAX_C(e2) << 6) | (UINTMAX_C(e3) << 5) | \
(UINTMAX_C(e4) << 4) | (UINTMAX_C(e5) << 3) | (UINTMAX_C(e6) << 2) | \
(UINTMAX_C(e7) << 1) | (UINTMAX_C(e8) << 0))
((UINT8_C(e1) << 7) | (UINT8_C(e2) << 6) | (UINT8_C(e3) << 5) | \
(UINT8_C(e4) << 4) | (UINT8_C(e5) << 3) | (UINT8_C(e6) << 2) | \
(UINT8_C(e7) << 1) | (UINT8_C(e8) << 0))
/**
* Returns true if token @a i is a token that belongs in an expression.

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -120,30 +120,6 @@ typedef struct BcHistory
extern const char bc_history_editrc[];
extern const size_t bc_history_editrc_len;
#ifdef __APPLE__
/**
* Returns true if the line is a valid line, false otherwise.
* @param line The line.
* @param len The length of the line.
* @return True if the line is valid, false otherwise.
*/
#define BC_HISTORY_INVALID_LINE(line, len) \
((line) == NULL && ((len) == -1 || errno == EINTR))
#else // __APPLE__
/**
* Returns true if the line is a valid line, false otherwise.
* @param line The line.
* @param len The length of the line.
* @return True if the line is valid, false otherwise.
*/
#define BC_HISTORY_INVALID_LINE(line, len) \
((line) == NULL && (len) == -1 && errno == EINTR)
#endif // __APPLE__
#else // BC_ENABLE_EDITLINE
#if BC_ENABLE_READLINE

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -533,6 +533,10 @@ typedef enum BcType
} BcType;
#if BC_ENABLED
/// Check if type array or array reference
#define BC_IS_ARRAY(e) (e == BC_TYPE_ARRAY || e == BC_TYPE_REF)
/// An auto variable in bc.
typedef struct BcAuto
{

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -145,6 +145,9 @@ typedef struct BcProgram
#endif // BC_ENABLED
/// The number of results that have not been retired.
size_t nresults;
// The BcDig array for strmb. This uses BC_NUM_LONG_LOG10 because it is used
// in bc_num_ulong2num(), which attempts to realloc, unless it is big
// enough. This is big enough.
@ -207,11 +210,16 @@ typedef struct BcProgram
* operands while preserving the result (which we assumed was pushed before the
* actual operation).
* @param p The program.
* @param nres The number of results returned by the instruction.
* @param nops The number of operands used by the instruction.
*/
#define bc_program_retire(p, nres, nops) \
(bc_vec_npopAt(&(p)->results, (nops), (p)->results.len - (nres + nops)))
#define bc_program_retire(p, nops) \
do \
{ \
bc_vec_npopAt(&(p)->results, (nops), \
(p)->results.len - ((p)->nresults + nops)); \
p->nresults = 0; \
} \
while (0)
#if DC_ENABLED

View file

@ -13,7 +13,7 @@
* This code is under the following license:
*
* Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -683,12 +683,7 @@ typedef enum BcMode
#define BC_NO_SIG_EXC(vm) \
BC_LIKELY((vm)->status == (sig_atomic_t) BC_STATUS_SUCCESS && !(vm)->sig)
#ifndef _WIN32
#define BC_SIG_INTERRUPT(vm) \
BC_UNLIKELY((vm)->sig != 0 && (vm)->sig != SIGWINCH)
#else // _WIN32
#define BC_SIG_INTERRUPT(vm) BC_UNLIKELY((vm)->sig != 0)
#endif // _WIN32
#if BC_DEBUG

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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,42 +0,0 @@
/*
* *****************************************************************************
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 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.
*
* *****************************************************************************
*
* The version of bc.
*
*/
#ifndef BC_VERSION_H
#define BC_VERSION_H
/// The current version.
#define VERSION 7.0.2
#endif // BC_VERSION_H

View file

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2018-2024 Gavin D. Howard and contributors.
* Copyright (c) 2018-2025 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:
@ -52,7 +52,6 @@
#endif // BC_ENABLE_NLS
#include <version.h>
#include <status.h>
#include <num.h>
#include <lex.h>

View file

@ -1,7 +1,7 @@
$ $
$ SPDX-License-Identifier: BSD-2-Clause
$ $
$ Copyright (c) 2018-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
$ Copyright (c) 2018-2025 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-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -2109,17 +2109,6 @@ If you want to a use signed two\[cq]s complement argument, use
\f[B]s2u(x)\f[R] to convert.
.RE
.TP
\f[B]bunrev(t)\f[R]
Assumes \f[B]t\f[R] is a bitwise\-reversed number with an extra set bit
one place more significant than the real most significant bit (which was
the least significant bit in the original number).
This number is reversed and returned without the extra set bit.
.RS
.PP
This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that
\f[B]\-1\f[R] and less than \f[B]1\f[R], it is printed with a leading
@ -2943,7 +2932,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1766,16 +1766,6 @@ The extended library is a **non-portable extension**.
If you want to a use signed two's complement argument, use **s2u(x)** to
convert.
**bunrev(t)**
: Assumes **t** is a bitwise-reversed number with an extra set bit one place
more significant than the real most significant bit (which was the least
significant bit in the original number). This number is reversed and
returned without the extra set bit.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
@ -2521,7 +2511,7 @@ This bc(1) supports error messages for different locales, and thus, it supports
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1758,7 +1758,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1509,7 +1509,7 @@ This bc(1) supports error messages for different locales, and thus, it supports
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1731,7 +1731,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1483,7 +1483,7 @@ This bc(1) supports error messages for different locales, and thus, it supports
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1725,7 +1725,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1475,7 +1475,7 @@ use a period (**.**) as a radix point, regardless of the value of
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1752,7 +1752,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1501,7 +1501,7 @@ use a period (**.**) as a radix point, regardless of the value of
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -2109,17 +2109,6 @@ If you want to a use signed two\[cq]s complement argument, use
\f[B]s2u(x)\f[R] to convert.
.RE
.TP
\f[B]bunrev(t)\f[R]
Assumes \f[B]t\f[R] is a bitwise\-reversed number with an extra set bit
one place more significant than the real most significant bit (which was
the least significant bit in the original number).
This number is reversed and returned without the extra set bit.
.RS
.PP
This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that
\f[B]\-1\f[R] and less than \f[B]1\f[R], it is printed with a leading
@ -2916,7 +2905,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1766,16 +1766,6 @@ The extended library is a **non-portable extension**.
If you want to a use signed two's complement argument, use **s2u(x)** to
convert.
**bunrev(t)**
: Assumes **t** is a bitwise-reversed number with an extra set bit one place
more significant than the real most significant bit (which was the least
significant bit in the original number). This number is reversed and
returned without the extra set bit.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
@ -2495,7 +2485,7 @@ This bc(1) supports error messages for different locales, and thus, it supports
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -2109,17 +2109,6 @@ If you want to a use signed two\[cq]s complement argument, use
\f[B]s2u(x)\f[R] to convert.
.RE
.TP
\f[B]bunrev(t)\f[R]
Assumes \f[B]t\f[R] is a bitwise\-reversed number with an extra set bit
one place more significant than the real most significant bit (which was
the least significant bit in the original number).
This number is reversed and returned without the extra set bit.
.RS
.PP
This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that
\f[B]\-1\f[R] and less than \f[B]1\f[R], it is printed with a leading
@ -2910,7 +2899,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1766,16 +1766,6 @@ The extended library is a **non-portable extension**.
If you want to a use signed two's complement argument, use **s2u(x)** to
convert.
**bunrev(t)**
: Assumes **t** is a bitwise-reversed number with an extra set bit one place
more significant than the real most significant bit (which was the least
significant bit in the original number). This number is reversed and
returned without the extra set bit.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
@ -2487,7 +2477,7 @@ use a period (**.**) as a radix point, regardless of the value of
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -2109,17 +2109,6 @@ If you want to a use signed two\[cq]s complement argument, use
\f[B]s2u(x)\f[R] to convert.
.RE
.TP
\f[B]bunrev(t)\f[R]
Assumes \f[B]t\f[R] is a bitwise\-reversed number with an extra set bit
one place more significant than the real most significant bit (which was
the least significant bit in the original number).
This number is reversed and returned without the extra set bit.
.RS
.PP
This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that
\f[B]\-1\f[R] and less than \f[B]1\f[R], it is printed with a leading
@ -2937,7 +2926,7 @@ Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
the \f[B]quit\f[R] statement.
.PP
No other bugs are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1766,16 +1766,6 @@ The extended library is a **non-portable extension**.
If you want to a use signed two's complement argument, use **s2u(x)** to
convert.
**bunrev(t)**
: Assumes **t** is a bitwise-reversed number with an extra set bit one place
more significant than the real most significant bit (which was the least
significant bit in the original number). This number is reversed and
returned without the extra set bit.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
@ -2513,7 +2503,7 @@ use a period (**.**) as a radix point, regardless of the value of
Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
statement.
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
No other bugs are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1833,7 +1833,7 @@ the value of \f[B]LC_NUMERIC\f[R].
This is also true of bcl(3).
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc.
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHORS
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1532,7 +1532,7 @@ use a period (**.**) as a radix point, regardless of the value of
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc.
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHORS

View file

@ -6,6 +6,9 @@ POSIX-compliant system.
To accomplish that, a POSIX-compatible, custom `configure.sh` script is used to
select build options, compiler, and compiler flags and generate a `Makefile`.
The rest of this document talks about that, *not* the build system using
[Rig][12], which is much simpler to understand, change, and use.
The general form of configuring, building, and installing this `bc` is as
follows:
@ -40,7 +43,7 @@ accepted build options.
## Windows
For releases, Windows builds of `bc`, `dc`, and `bcl` are available for download
from <https://git.gavinhoward.com/gavin/bc> and GitHub.
from GitHub.
However, if you wish to build it yourself, this `bc` can be built using Visual
Studio or MSBuild.
@ -993,3 +996,4 @@ Both commands are equivalent.
[9]: #nls-locale-support
[10]: #extra-math
[11]: #settings
[12]: https://rigbuild.dev/

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1687,7 +1687,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1522,7 +1522,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1466,7 +1466,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1346,7 +1346,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1442,7 +1442,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1323,7 +1323,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1439,7 +1439,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1318,7 +1318,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1463,7 +1463,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1341,7 +1341,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1663,7 +1663,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1499,7 +1499,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1660,7 +1660,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1494,7 +1494,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -1,7 +1,7 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" Copyright (c) 2018-2024 Gavin D. Howard and contributors.
.\" Copyright (c) 2018-2025 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:
@ -1684,7 +1684,7 @@ specification at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
None are known.
Report bugs at https://git.gavinhoward.com/gavin/bc .
Report bugs at https://github.com/gavinhoward/bc .
.SH AUTHOR
Gavin D. Howard \c
.MT gavin@gavinhoward.com

View file

@ -2,7 +2,7 @@
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2018-2024 Gavin D. Howard and contributors.
Copyright (c) 2018-2025 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:
@ -1517,7 +1517,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
None are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
None are known. Report bugs at https://github.com/gavinhoward/bc .
# AUTHOR

View file

@ -0,0 +1,32 @@
# `bc` Project Management History
This directory has the project management history of `bc`. This `README` exists
to explain what the files are.
* `gitea.db`
Because I (Gavin Howard, the main author) do not trust big companies, I moved
`bc` to a self-hosted Gitea instance. This is what's left of the database from
that instance. Obviously, I wiped of personal identifying information as much
as possible, but it still has the comments on issues and pull requests, as
well as the issues and pull requests themselves (whatever matters anyway).
* `github_issues.json`
This is information about issues reported on GitHub. I used the GitHub CLI to
export *all* of the available information, since it's public.
* `github_prs.json`
This is information about pull requests opened on GitHub. I used the GitHub
CLI to export *all* of the available information, since it's public.
* `issue10.md`
When I first started self-hosting Gitea, I was not a good sysadmin. On top of
that, I was learning how to use OpenZFS, and Gitea was stored in a ZFS
dataset.
This is the best I could do to reproduce an actual issue that was reported and
got erased when I rolled back to a ZFS snapshot. It was originally `#10` on
Gitea, hence the file name.

BIN
contrib/bc/project/gitea.db Normal file

Binary file not shown.

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