Date: Fri, 24 Feb 2023 22:55:02 GMT From: =?utf-8?Q?Stefan=20E=C3=9Fer?= <se@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 103d7cdfb743 - main - vendor/bc: import version 6.3.1 Message-ID: <202302242255.31OMt2RH098248@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=103d7cdfb7435591049413e1bc39482cb316efb7 commit 103d7cdfb7435591049413e1bc39482cb316efb7 Author: Stefan Eßer <se@FreeBSD.org> AuthorDate: 2023-02-24 22:14:58 +0000 Commit: Stefan Eßer <se@FreeBSD.org> CommitDate: 2023-02-24 22:52:09 +0000 vendor/bc: import version 6.3.1 This version adds a command to dc to query whether extended registers are enabled or not. (cherry picked from commit 61e1a12bb6c3bfdb0a4e499c88e8eaa2b548e427) --- contrib/bc/MEMORY_BUGS.md | 5 ++ contrib/bc/Makefile.in | 10 +-- contrib/bc/NEWS.md | 25 ++++++++ contrib/bc/gen/lib2.bc | 4 +- contrib/bc/gen/strgen.c | 6 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/bcl.h | 6 ++ contrib/bc/include/lang.h | 7 +- contrib/bc/include/lex.h | 17 +++-- contrib/bc/include/parse.h | 14 ++-- contrib/bc/include/program.h | 12 ++-- contrib/bc/include/rand.h | 6 +- contrib/bc/include/status.h | 24 +++---- contrib/bc/include/vector.h | 4 +- contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 6 +- contrib/bc/manuals/bc/A.1 | 6 +- contrib/bc/manuals/bc/A.1.md | 2 +- contrib/bc/manuals/bc/E.1 | 6 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 6 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 6 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 6 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 6 +- contrib/bc/manuals/bc/H.1.md | 2 +- contrib/bc/manuals/bc/HN.1 | 6 +- contrib/bc/manuals/bc/HN.1.md | 2 +- contrib/bc/manuals/bc/N.1 | 6 +- contrib/bc/manuals/bc/N.1.md | 2 +- contrib/bc/manuals/bcl.3 | 2 +- contrib/bc/manuals/dc/A.1 | 12 ++-- contrib/bc/manuals/dc/A.1.md | 10 +-- contrib/bc/manuals/dc/E.1 | 12 ++-- contrib/bc/manuals/dc/E.1.md | 10 +-- contrib/bc/manuals/dc/EH.1 | 12 ++-- contrib/bc/manuals/dc/EH.1.md | 10 +-- contrib/bc/manuals/dc/EHN.1 | 12 ++-- contrib/bc/manuals/dc/EHN.1.md | 10 +-- contrib/bc/manuals/dc/EN.1 | 12 ++-- contrib/bc/manuals/dc/EN.1.md | 10 +-- contrib/bc/manuals/dc/H.1 | 12 ++-- contrib/bc/manuals/dc/H.1.md | 10 +-- contrib/bc/manuals/dc/HN.1 | 12 ++-- contrib/bc/manuals/dc/HN.1.md | 10 +-- contrib/bc/manuals/dc/N.1 | 12 ++-- contrib/bc/manuals/dc/N.1.md | 10 +-- contrib/bc/scripts/exec-install.sh | 6 ++ contrib/bc/scripts/format.sh | 2 + contrib/bc/scripts/link.sh | 5 ++ contrib/bc/scripts/lint.sh | 5 +- contrib/bc/scripts/locale_install.sh | 3 +- contrib/bc/scripts/safe-install.sh | 12 ++-- contrib/bc/src/args.c | 4 +- contrib/bc/src/bc_parse.c | 6 +- contrib/bc/src/data.c | 16 ++--- contrib/bc/src/dc_lex.c | 1 + contrib/bc/src/dc_parse.c | 1 + contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 4 +- contrib/bc/src/lang.c | 8 +-- contrib/bc/src/library.c | 4 +- contrib/bc/src/num.c | 12 ++-- contrib/bc/src/parse.c | 4 +- contrib/bc/src/program.c | 49 ++++++++------ contrib/bc/src/read.c | 4 +- contrib/bc/src/vm.c | 34 +++++----- contrib/bc/tests/all.sh | 3 +- contrib/bc/tests/error.sh | 8 +-- contrib/bc/tests/errors.sh | 8 +-- contrib/bc/tests/other.sh | 120 ++++++++++++++++++++++------------- contrib/bc/tests/script.sh | 6 +- contrib/bc/tests/scripts.sh | 5 +- contrib/bc/tests/test.sh | 6 +- contrib/bc/vs/bc.vcxproj | 2 +- 77 files changed, 442 insertions(+), 294 deletions(-) diff --git a/contrib/bc/MEMORY_BUGS.md b/contrib/bc/MEMORY_BUGS.md index d675b28b342a..12e0b854e9d8 100644 --- a/contrib/bc/MEMORY_BUGS.md +++ b/contrib/bc/MEMORY_BUGS.md @@ -51,3 +51,8 @@ existed in. had properly hooked Valgrind into my `bcl` tests, but I had not. The first version without this bug is `6.0.1`. + +* In version `6.0.0` until `6.2.4` (inclusive) of `bcl`, there is a possible + use-after-free if `bcl_init()` fails. + + The first version without this bug is `6.2.5`. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 83417a333826..89ddb7589c47 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -239,25 +239,25 @@ $(GEN_EXEC): $(GEN_DIR) %%GEN_EXEC_TARGET%% $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) "" "" 1 $(BC_LIB_O): $(BC_LIB_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) "" "" 1 $(BC_LIB2_O): $(BC_LIB2_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) 0 $(BC_HELP_O): $(BC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) 0 $(DC_HELP_O): $(DC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< @@ -536,6 +536,7 @@ clean:%%CLEAN_PREREQS%% @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) @$(RM) -fr vs/bin/ vs/lib/ + @$(RM) -f $(BCL_PC) clean_benchmarks: @printf 'Cleaning benchmarks...\n' @@ -548,6 +549,7 @@ clean_config: clean clean_benchmarks @$(RM) -f Makefile @$(RM) -f $(BC_MD) $(BC_MANPAGE) @$(RM) -f $(DC_MD) $(DC_MANPAGE) + @$(RM) -f compile_commands.json clean_coverage: @printf 'Cleaning coverage files...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 4601db456f86..ad118e401c32 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,30 @@ # News +## 6.3.1 + +This is a production release that fixes a `bc` dependency loop for minimal +environments and Linux from Scratch. + +## 6.3.0 + +This is a production release with a couple of fixes for manuals and a new +feature for `dc`: there is now a command to query whether extended registers are +enabled or not. + +Users who don't care do not need to upgrade. + +## 6.2.6 + +This is a production release that fixes an install bug that affected locale +installation of all locales when using `mksh`. Users do ***NOT*** need to +upgrade if they don't use `mksh` and/or don't need to install all locales. + +## 6.2.5 + +This is a production release that fixes a test bug that affected Android and +`mksh`. Users do ***NOT*** need to upgrade unless they use `mksh` or another +affected shell and need to run the test suite. + ## 6.2.4 This is a production release that fixes a test failure that happens when diff --git a/contrib/bc/gen/lib2.bc b/contrib/bc/gen/lib2.bc index 826f8a430cea..2811430d534e 100644 --- a/contrib/bc/gen/lib2.bc +++ b/contrib/bc/gen/lib2.bc @@ -36,7 +36,7 @@ define p(x,y){ auto a a=y$ - if(y==a)return (x^a)@scale + if(y==a)return(x^a)@scale return e(y*l(x)) } define r(x,p){ @@ -474,7 +474,7 @@ define bxor(a,b){ return bunrev(t) } define bshl(a,b){return abs(a)$*2^abs(b)$} -define bshr(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[] s=scale diff --git a/contrib/bc/gen/strgen.c b/contrib/bc/gen/strgen.c index dbea0212f617..2cb3ed9e8475 100644 --- a/contrib/bc/gen/strgen.c +++ b/contrib/bc/gen/strgen.c @@ -157,11 +157,11 @@ bc_read_file(const char* path) assert(path != NULL); -#ifndef NDEBUG +#if BC_DEBUG // Need this to quiet MSan. // NOLINTNEXTLINE memset(&pstat, 0, sizeof(struct stat)); -#endif // NDEBUG +#endif // BC_DEBUG fd = bc_read_open(path, O_RDONLY); @@ -360,7 +360,7 @@ main(int argc, char* argv[]) has_define = (argc > 6 && strcmp("", argv[6]) != 0); define = has_define ? argv[6] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 7 && atoi(argv[7]) != 0); in = bc_read_file(argv[1]); if (in == NULL) return INVALID_INPUT_FILE; diff --git a/contrib/bc/gen/strgen.sh b/contrib/bc/gen/strgen.sh index a65e221ad0b4..2b8927b5528e 100755 --- a/contrib/bc/gen/strgen.sh +++ b/contrib/bc/gen/strgen.sh @@ -62,7 +62,9 @@ name="$4" label="$5" define="$6" remove_tabs="$7" -check_bool_arg "$remove_tabs" +if [ "$remove_tabs" != "" ]; then + check_bool_arg "$remove_tabs" +fi tmpinput=$(mktemp -t "${input##*/}_XXXXXX") diff --git a/contrib/bc/include/bcl.h b/contrib/bc/include/bcl.h index 234fe475f00e..253138231c66 100644 --- a/contrib/bc/include/bcl.h +++ b/contrib/bc/include/bcl.h @@ -41,6 +41,12 @@ #include <limits.h> #include <stdint.h> +#ifndef NDEBUG +#define BC_DEBUG (1) +#else // NDEBUG +#define BC_DEBUG (0) +#endif // NDEBUG + #ifdef _WIN32 #include <Windows.h> #include <BaseTsd.h> diff --git a/contrib/bc/include/lang.h b/contrib/bc/include/lang.h index 2d9776532249..97aeeaa98da8 100644 --- a/contrib/bc/include/lang.h +++ b/contrib/bc/include/lang.h @@ -277,6 +277,9 @@ typedef enum BcInst #if DC_ENABLED + /// dc extended registers command. + BC_INST_EXTENDED_REGISTERS, + /// dc's return; it pops an executing string off of the stack. BC_INST_POP_EXEC, @@ -575,7 +578,7 @@ bc_func_insert(BcFunc* f, struct BcProgram* p, char* name, BcType type, void bc_func_reset(BcFunc* f); -#ifndef NDEBUG +#if BC_DEBUG /** * Frees a function. This is a destructor. This is only used in debug builds * because all functions are freed at exit. We free them in debug builds to @@ -584,7 +587,7 @@ bc_func_reset(BcFunc* f); */ void bc_func_free(void* func); -#endif // NDEBUG +#endif // BC_DEBUG /** * Initializes an array, which is the array type in bc and dc source code. Since diff --git a/contrib/bc/include/lex.h b/contrib/bc/include/lex.h index 54d704f8b447..ac9b7b6ea69c 100644 --- a/contrib/bc/include/lex.h +++ b/contrib/bc/include/lex.h @@ -49,11 +49,11 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) -#endif // NDEBUG +#endif // BC_DEBUG /** * A convenience macro for throwing errors in lex code. This takes care of @@ -61,12 +61,12 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_verr(l, e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG // BC_LEX_NEG_CHAR returns the char that corresponds to negative for the // current calculator. @@ -409,6 +409,9 @@ typedef enum BcLexType #if DC_ENABLED + /// dc extended registers keyword. + BC_LEX_EXTENDED_REGISTERS, + /// A special token for dc to calculate equal without a register. BC_LEX_EQ_NO_REG, @@ -533,7 +536,7 @@ void bc_lex_init(BcLex* l); /** - * Frees a lexer. This is not guarded by #ifndef NDEBUG because a separate + * Frees a lexer. This is not guarded by #if BC_DEBUG because a separate * parser is created at runtime to parse read() expressions and dc strings, and * that parser needs a lexer. * @param l The lexer to free. diff --git a/contrib/bc/include/parse.h b/contrib/bc/include/parse.h index 2527aeb824f8..ece413e7bd74 100644 --- a/contrib/bc/include/parse.h +++ b/contrib/bc/include/parse.h @@ -110,12 +110,12 @@ * @param p The parser. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_parse_err(p, e) \ (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line)) -#else // NDEBUG +#else // BC_DEBUG #define bc_parse_err(p, e) (bc_vm_handleError((e), (p)->l.line)) -#endif // NDEBUG +#endif // BC_DEBUG /** * A convenience macro for throwing errors in parse code. This takes care of @@ -124,13 +124,13 @@ * @param e The error. * @param ... The varags that are needed. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_parse_verr(p, e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_parse_verr(p, e, ...) \ (bc_vm_handleError((e), (p)->l.line, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG // Forward declarations. struct BcParse; @@ -215,7 +215,7 @@ void bc_parse_init(BcParse* p, struct BcProgram* prog, size_t func); /** - * Frees a parser. This is not guarded by #ifndef NDEBUG because a separate + * Frees a parser. This is not guarded by #if BC_DEBUG because a separate * parser is created at runtime to parse read() expressions and dc strings. * @param p The parser to free. */ diff --git a/contrib/bc/include/program.h b/contrib/bc/include/program.h index 3a3ea6c9dab7..ff32d5db7760 100644 --- a/contrib/bc/include/program.h +++ b/contrib/bc/include/program.h @@ -247,9 +247,9 @@ typedef struct BcProgram // In debug mode, we want bc to check the stack, but otherwise, we don't because // the bc language implicitly mandates that the stack should always have enough // items. -#ifdef NDEBUG +#ifdef BC_DEBUG #define BC_PROG_NO_STACK_CHECK -#endif // NDEBUG +#endif // BC_DEBUG #endif // DC_ENABLED @@ -298,7 +298,7 @@ typedef void (*BcProgramUnary)(BcResult* r, BcNum* n); void bc_program_init(BcProgram* p); -#ifndef NDEBUG +#if BC_DEBUG /** * Frees a BcProgram. This is only used in debug builds because a BcProgram is @@ -309,7 +309,7 @@ bc_program_init(BcProgram* p); void bc_program_free(BcProgram* p); -#endif // NDEBUG +#endif // BC_DEBUG /** * Prints a stack trace of the bc functions or dc strings currently executing. @@ -608,6 +608,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ @@ -701,6 +702,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ @@ -959,6 +961,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ @@ -1027,6 +1030,7 @@ extern const char bc_program_esc_seqs[]; &&lbl_BC_INST_MODEXP, \ &&lbl_BC_INST_DIVMOD, \ &&lbl_BC_INST_PRINT_STREAM, \ + &&lbl_BC_INST_EXTENDED_REGISTERS, \ &&lbl_BC_INST_POP_EXEC, \ &&lbl_BC_INST_EXECUTE, \ &&lbl_BC_INST_EXEC_COND, \ diff --git a/contrib/bc/include/rand.h b/contrib/bc/include/rand.h index 7db0ee90af1f..e516295d7c5c 100644 --- a/contrib/bc/include/rand.h +++ b/contrib/bc/include/rand.h @@ -53,11 +53,11 @@ #if BC_ENABLE_LIBRARY #define BC_RAND_USE_FREE (1) #else // BC_ENABLE_LIBRARY -#ifndef NDEBUG +#if BC_DEBUG #define BC_RAND_USE_FREE (1) -#else // NDEBUG +#else // BC_DEBUG #define BC_RAND_USE_FREE (0) -#endif // NDEBUG +#endif // BC_DEBUG #endif // BC_ENABLE_LIBRARY /** diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 9962d58d0be0..198cf5704a57 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -700,7 +700,7 @@ typedef enum BcMode #define BC_SIG_INTERRUPT(vm) BC_UNLIKELY((vm)->sig != 0) #endif // _WIN32 -#ifndef NDEBUG +#if BC_DEBUG /// Assert that signals are locked. There are non-async-signal-safe functions in /// bc, and they *must* have signals locked. Other functions are expected to @@ -724,7 +724,7 @@ typedef enum BcMode } \ while (0) -#else // NDEBUG +#else // BC_DEBUG /// Assert that signals are locked. There are non-async-signal-safe functions in /// bc, and they *must* have signals locked. Other functions are expected to @@ -738,7 +738,7 @@ typedef enum BcMode /// (no-op in non-debug mode) that check that signals are unlocked. #define BC_SIG_ASSERT_NOT_LOCKED -#endif // NDEBUG +#endif // BC_DEBUG /// Locks signals. #define BC_SIG_LOCK \ @@ -957,33 +957,33 @@ typedef enum BcMode * @param l The line of the script that the error happened. * @param ... Extra arguments for error messages as necessary. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_error(e, l, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (l), __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_error(e, l, ...) (bc_vm_handleError((e), (l), __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG /** * Call bc's error handling routine. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_err(e) (bc_vm_handleError((e), __FILE__, __LINE__, 0)) -#else // NDEBUG +#else // BC_DEBUG #define bc_err(e) (bc_vm_handleError((e), 0)) -#endif // NDEBUG +#endif // BC_DEBUG /** * Call bc's error handling routine. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_verr(e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, 0, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_verr(e, ...) (bc_vm_handleError((e), 0, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG #endif // BC_ENABLE_LIBRARY diff --git a/contrib/bc/include/vector.h b/contrib/bc/include/vector.h index 51c5e8b95293..b86be1424537 100644 --- a/contrib/bc/include/vector.h +++ b/contrib/bc/include/vector.h @@ -85,12 +85,12 @@ typedef enum BcDtorType #if !BC_ENABLE_LIBRARY -#ifndef NDEBUG +#if BC_DEBUG /// BcFunc destructor. BC_DTOR_FUNC, -#endif // NDEBUG +#endif // BC_DEBUG /// BcSlab destructor. BC_DTOR_SLAB, diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index 6d8ddfea0940..f5e345b3b189 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.2.4 +#define VERSION 6.3.1 #endif // BC_VERSION_H diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 1c303add2de0..dd21d43f5260 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -999,7 +999,7 @@ bc_vm_atexit(void); size_t bc_vm_numDigits(size_t val); -#ifndef NDEBUG +#if BC_DEBUG /** * Handle an error. This is the true error handler. It will start a jump series @@ -1013,7 +1013,7 @@ bc_vm_numDigits(size_t val); void bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...); -#else // NDEBUG +#else // BC_DEBUG /** * Handle an error. This is the true error handler. It will start a jump series @@ -1025,7 +1025,7 @@ bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...); void bc_vm_handleError(BcErr e, size_t line, ...); -#endif // NDEBUG +#endif // BC_DEBUG /** * Handle a fatal error. diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index b1996a1f282e..5de2d3529bcf 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index e7b4c8212190..3f34f451c9ed 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index fea1cecdc4c5..ecb8b128712a 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md index 3631267f2dc9..5411dcf6cc70 100644 --- a/contrib/bc/manuals/bc/E.1.md +++ b/contrib/bc/manuals/bc/E.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index 2a36cab7f778..507e7f4a9a7a 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md index f2f49ea76944..6f4c43263003 100644 --- a/contrib/bc/manuals/bc/EH.1.md +++ b/contrib/bc/manuals/bc/EH.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index 75768a03c141..e00fcd578b1c 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md index a38503cc8a24..6f7a33210205 100644 --- a/contrib/bc/manuals/bc/EHN.1.md +++ b/contrib/bc/manuals/bc/EHN.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index 9c0158583199..ea842eac7e97 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -433,8 +433,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/EN.1.md b/contrib/bc/manuals/bc/EN.1.md index 28b558d8b21d..189193bf2a03 100644 --- a/contrib/bc/manuals/bc/EN.1.md +++ b/contrib/bc/manuals/bc/EN.1.md @@ -344,7 +344,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1 index cbd93da0df81..d477dc8ab24b 100644 --- a/contrib/bc/manuals/bc/H.1 +++ b/contrib/bc/manuals/bc/H.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md index ac35def9019f..2cb0b4eb27cc 100644 --- a/contrib/bc/manuals/bc/H.1.md +++ b/contrib/bc/manuals/bc/H.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1 index 5893d2a7f9a9..10d9621c42ee 100644 --- a/contrib/bc/manuals/bc/HN.1 +++ b/contrib/bc/manuals/bc/HN.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md index 82a99addd344..25f136a21e0a 100644 --- a/contrib/bc/manuals/bc/HN.1.md +++ b/contrib/bc/manuals/bc/HN.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1 index 791f47407001..f39e51277b65 100644 --- a/contrib/bc/manuals/bc/N.1 +++ b/contrib/bc/manuals/bc/N.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH NAME @@ -477,8 +477,8 @@ Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than .RS .PP This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). +\f[B]plznl(x)\f[R], \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions +in the extended math library (see the \f[B]LIBRARY\f[R] section). .PP This is a \f[B]non-portable extension\f[R]. .RE diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md index b8339ea31a5e..56a4b2274d29 100644 --- a/contrib/bc/manuals/bc/N.1.md +++ b/contrib/bc/manuals/bc/N.1.md @@ -372,7 +372,7 @@ The following are the options that bc(1) accepts. : Makes bc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, + This can be set for individual numbers with the **plz(x)**, **plznl(x)**, **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see the **LIBRARY** section). diff --git a/contrib/bc/manuals/bcl.3 b/contrib/bc/manuals/bcl.3 index 6bebaa8f02cd..5c3731a141eb 100644 --- a/contrib/bc/manuals/bcl.3 +++ b/contrib/bc/manuals/bcl.3 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BCL" "3" "October 2022" "Gavin D. Howard" "Libraries Manual" +.TH "BCL" "3" "February 2023" "Gavin D. Howard" "Libraries Manual" .nh .ad l .SH NAME diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index 13ed8c4cf808..bef54876d7f2 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "February 2023" "Gavin D. Howard" "General Commands Manual" .nh .ad l .SH Name @@ -271,10 +271,6 @@ Makes dc(1) print all numbers greater than \f[B]-1\f[R] and less than \f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero. .RS .PP -This can be set for individual numbers with the \f[B]plz(x)\f[R], -plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the -extended math library (see the \f[B]LIBRARY\f[R] section). -.PP This is a \f[B]non-portable extension\f[R]. .RE .PP @@ -1255,6 +1251,12 @@ section). Pushes the line length set by \f[B]DC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R] section) onto the stack. .TP +\f[B]gx\f[R] +Pushes \f[B]1\f[R] onto the stack if extended register mode is on, +\f[B]0\f[R] otherwise. +See the \f[I]Extended Register Mode\f[R] subsection of the +\f[B]REGISTERS\f[R] section for more information. +.TP \f[B]gz\f[R] Pushes \f[B]0\f[R] onto the stack if the leading zero setting has not been enabled with the \f[B]-z\f[R] or \f[B]--leading-zeroes\f[R] options diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index b656650cb820..44b1578b670c 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -224,10 +224,6 @@ The following are the options that dc(1) accepts. : Makes dc(1) print all numbers greater than **-1** and less than **1**, and not equal to **0**, with a leading zero. - This can be set for individual numbers with the **plz(x)**, plznl(x)**, - **pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see - the **LIBRARY** section). - This is a **non-portable extension**. *** 1694 LINES SKIPPED ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302242255.31OMt2RH098248>