From d3b3813c94d6553caad61752dd7ac99dd860e20c Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 14 Jan 2020 21:56:45 +0000 Subject: [PATCH 1/7] Fix bug caused by inconsistent preservation of line endings by 'sed'. --- configure.sh | 2 +- functions.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.sh b/configure.sh index 46e37bfc2..ec7b99936 100755 --- a/configure.sh +++ b/configure.sh @@ -212,7 +212,7 @@ replace_ext() { _replace_ext_ext1="$2" _replace_ext_ext2="$3" - _replace_ext_result=$(printf "$_replace_ext_file" | sed -e "s@\.$_replace_ext_ext1@\.$_replace_ext_ext2@") + _replace_ext_result=${_replace_ext_file%.$_replace_ext_ext1}.$_replace_ext_ext2 printf '%s\n' "$_replace_ext_result" } diff --git a/functions.sh b/functions.sh index 0ff0a0ea4..8a81b8b2a 100755 --- a/functions.sh +++ b/functions.sh @@ -156,10 +156,10 @@ substring_replace() { _substring_replace_replacement="$1" shift - _substring_replace_result=$(printf '%s' "$_substring_replace_str" | \ + _substring_replace_result=$(printf '%s\n' "$_substring_replace_str" | \ sed -e "s!$_substring_replace_needle!$_substring_replace_replacement!g") - printf '%s\n' "$_substring_replace_result" + printf '%s' "$_substring_replace_result" } gen_nlspath() { From 72238e589bf7e8cb6a9bb380f367c1a5edcc8b82 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 14 Jan 2020 22:03:42 +0000 Subject: [PATCH 2/7] Switch from POSIX 2008 --> 2001 build flags. Remove use of dangerous 'ls' command. Improve robustness of test conditions. --- Makefile.in | 2 +- README.md | 4 ++-- configure.sh | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2c7fc4e04..5d0e721ae 100644 --- a/Makefile.in +++ b/Makefile.in @@ -140,7 +140,7 @@ BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DVERSION=$(VERSION) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 +CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) diff --git a/README.md b/README.md index 2784cbedf..52294d6ba 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ This `bc` is Free and Open Source Software (FOSS). It is offered under the BSD ## Prerequisites This `bc` only requires a C99-compatible compiler and a (mostly) POSIX -2008-compatible system with the XSI (X/Open System Interfaces) option group. +2001-compatible system with the XSI (X/Open System Interfaces) option group. -Since POSIX 2008 with XSI requires the existence of a C99 compiler as `c99`, any +Since POSIX 2001 with XSI requires the existence of a C99 compiler as `c99`, any POSIX and XSI-compatible system will have everything needed. Systems that are known to work: diff --git a/configure.sh b/configure.sh index ec7b99936..6bfab29b2 100755 --- a/configure.sh +++ b/configure.sh @@ -278,7 +278,7 @@ gen_file_lists() { if [ "$_gen_file_lists_use" -ne 0 ]; then - _gen_file_lists_replacement=$(ls $_gen_file_lists_filedir/*.c | tr '\n' ' ') + _gen_file_lists_replacement=$(cd "$_gen_file_lists_filedir" && find . ! -name . -prune -name "*.c" | cut -d/ -f2 | sed "s@^@$_gen_file_lists_filedir/@g" | tr '\n' ' ') _gen_file_lists_contents=$(replace "$_gen_file_lists_contents" "$_gen_file_lists_needle_src" "$_gen_file_lists_replacement") _gen_file_lists_replacement=$(replace_exts "$_gen_file_lists_replacement" "c" "o") @@ -441,7 +441,7 @@ while getopts "bBcdDEfgGhHk:MNO:PST-" opt; do done -if [ "$bc_only" -eq 1 -a "$dc_only" -eq 1 ]; then +if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then usage "Can only specify one of -b(-D) or -d(-B)" fi @@ -550,7 +550,7 @@ else LONG_BIT_DEFINE="-DBC_LONG_BIT=\$(BC_LONG_BIT)" fi -if [ -z "${HOSTCFLAGS+set}" -a -z "${HOST_CFLAGS+set}" ]; then +if [ -z "${HOSTCFLAGS+set}" ] && [ -z "${HOST_CFLAGS+set}" ]; then HOSTCFLAGS="$CFLAGS" elif [ -z "${HOSTCFLAGS+set}" ]; then HOSTCFLAGS="$HOST_CFLAGS" @@ -558,7 +558,7 @@ fi if [ "$debug" -eq 1 ]; then - if [ -z "$CFLAGS" -a -z "$optimization" ]; then + if [ -z "$CFLAGS" ] && [ -z "$optimization" ]; then CFLAGS="-O0" fi @@ -577,7 +577,7 @@ fi if [ "$coverage" -eq 1 ]; then - if [ "$bc_only" -eq 1 -o "$dc_only" -eq 1 ]; then + if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then usage "Can only specify -c without -b or -d" fi @@ -608,7 +608,7 @@ if [ -z "${BINDIR+set}" ]; then BINDIR="$PREFIX/bin" fi -if [ "$install_manpages" -ne 0 -o "$nls" -ne 0 ]; then +if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then if [ -z "${DATAROOTDIR+set}" ]; then DATAROOTDIR="$PREFIX/share" fi @@ -637,7 +637,7 @@ if [ -z "$CC" ]; then CC="c99" fi -if [ -z "$HOSTCC" -a -z "$HOST_CC" ]; then +if [ -z "$HOSTCC" ] && [ -z "$HOST_CC" ]; then HOSTCC="$CC" elif [ -z "$HOSTCC" ]; then HOSTCC="$HOST_CC" @@ -652,7 +652,7 @@ if [ "$nls" -ne 0 ]; then flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc -DBC_ENABLE_SIGNALS=$signals" flags="$flags -DBC_ENABLE_HISTORY=$hist" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" "$HOSTCC" $HOSTCFLAGS $flags -c "src/vm.c" -o "$scriptdir/vm.o" > /dev/null 2>&1 @@ -725,7 +725,7 @@ if [ "$hist" -eq 1 ]; then flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc -DBC_ENABLE_SIGNALS=$signals" flags="$flags -DBC_ENABLE_NLS=$nls" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" - flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" + flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" "$HOSTCC" $HOSTCFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 @@ -751,7 +751,7 @@ if [ "$hist" -eq 1 ]; then fi -if [ "$extra_math" -eq 1 -a "$bc" -ne 0 ]; then +if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ]; then BC_LIB2_O="\$(GEN_DIR)/lib2.o" else BC_LIB2_O="" From eb34ee5e9d5607c08e7080d9c44e03d393756493 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 14 Jan 2020 22:05:02 +0000 Subject: [PATCH 3/7] Update copyright year 2019 --> 2020. --- Makefile.in | 2 +- configure.sh | 2 +- functions.sh | 2 +- gen/bc_help.txt | 2 +- gen/dc_help.txt | 2 +- gen/lib.bc | 2 +- gen/lib2.bc | 2 +- gen/strgen.c | 4 ++-- include/args.h | 2 +- include/bc.h | 2 +- include/dc.h | 2 +- include/history.h | 2 +- include/lang.h | 2 +- include/lex.h | 2 +- include/num.h | 2 +- include/parse.h | 2 +- include/program.h | 2 +- include/read.h | 2 +- include/status.h | 2 +- include/vector.h | 2 +- include/vm.h | 2 +- install.sh | 2 +- karatsuba.py | 2 +- link.sh | 2 +- locale_install.sh | 2 +- locale_uninstall.sh | 2 +- locales/en_US.msg | 2 +- locales/fr_FR.ISO8859-1.msg | 2 +- locales/fr_FR.UTF-8.msg | 2 +- locales/pt_PT.ISO-8859-1.msg | 2 +- locales/pt_PT.UTF-8.msg | 2 +- release.sh | 2 +- src/args.c | 2 +- src/bc/bc.c | 2 +- src/bc/lex.c | 2 +- src/bc/parse.c | 2 +- src/data.c | 4 ++-- src/dc/dc.c | 2 +- src/dc/lex.c | 2 +- src/dc/parse.c | 2 +- src/history/history.c | 2 +- src/lang.c | 2 +- src/lex.c | 2 +- src/main.c | 2 +- src/num.c | 2 +- src/parse.c | 2 +- src/program.c | 2 +- src/read.c | 2 +- src/vector.c | 2 +- src/vm.c | 2 +- tests/afl.py | 2 +- tests/all.sh | 2 +- tests/bc/timeconst.sh | 2 +- tests/errors.sh | 2 +- tests/randmath.py | 2 +- tests/read.sh | 2 +- tests/script.sh | 2 +- tests/scripts.sh | 2 +- tests/stdin.sh | 2 +- tests/test.sh | 2 +- 60 files changed, 62 insertions(+), 62 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5d0e721ae..9d6e8d1f1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/configure.sh b/configure.sh index 6bfab29b2..f5c11a41b 100755 --- a/configure.sh +++ b/configure.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/functions.sh b/functions.sh index 8a81b8b2a..254e81c51 100755 --- a/functions.sh +++ b/functions.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/gen/bc_help.txt b/gen/bc_help.txt index 8272246ab..648ed2526 100644 --- a/gen/bc_help.txt +++ b/gen/bc_help.txt @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/gen/dc_help.txt b/gen/dc_help.txt index be064d928..18e990d9f 100644 --- a/gen/dc_help.txt +++ b/gen/dc_help.txt @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/gen/lib.bc b/gen/lib.bc index bdde8a777..8b60cb970 100644 --- a/gen/lib.bc +++ b/gen/lib.bc @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/gen/lib2.bc b/gen/lib2.bc index 9665b92ec..3b86486c2 100644 --- a/gen/lib2.bc +++ b/gen/lib2.bc @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/gen/strgen.c b/gen/strgen.c index bd7588c33..d741c1a79 100644 --- a/gen/strgen.c +++ b/gen/strgen.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * @@ -43,7 +43,7 @@ #include static const char* const bc_gen_header = - "// Copyright (c) 2018-2019 Gavin D. Howard and contributors.\n" + "// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n"; diff --git a/include/args.h b/include/args.h index 0b696f4f5..aa6dedeae 100644 --- a/include/args.h +++ b/include/args.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/bc.h b/include/bc.h index 62f2f568a..51114e7a4 100644 --- a/include/bc.h +++ b/include/bc.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/dc.h b/include/dc.h index 542416219..8d559f7ac 100644 --- a/include/dc.h +++ b/include/dc.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/history.h b/include/history.h index e257ec791..6ef6498e2 100644 --- a/include/history.h +++ b/include/history.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/lang.h b/include/lang.h index c327d1c25..39252dcf9 100644 --- a/include/lang.h +++ b/include/lang.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/lex.h b/include/lex.h index 9d8648bb7..43e6a45ec 100644 --- a/include/lex.h +++ b/include/lex.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/num.h b/include/num.h index 00180fc1f..ed232ba83 100644 --- a/include/num.h +++ b/include/num.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/parse.h b/include/parse.h index 685f7ecd6..2c8da6602 100644 --- a/include/parse.h +++ b/include/parse.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/program.h b/include/program.h index 726fc8f60..f070ea653 100644 --- a/include/program.h +++ b/include/program.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/read.h b/include/read.h index 13adbf73b..75bb4c5ce 100644 --- a/include/read.h +++ b/include/read.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/status.h b/include/status.h index 874beba56..a02458597 100644 --- a/include/status.h +++ b/include/status.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/vector.h b/include/vector.h index f9ec42d1c..8f3000e11 100644 --- a/include/vector.h +++ b/include/vector.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/include/vm.h b/include/vm.h index ad3e64572..77c29546f 100644 --- a/include/vm.h +++ b/include/vm.h @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/install.sh b/install.sh index 4446cb7db..15e6ba240 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/karatsuba.py b/karatsuba.py index 59644c421..9edcea66e 100755 --- a/karatsuba.py +++ b/karatsuba.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -B # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/link.sh b/link.sh index 2cf0a635c..4d9b46cf7 100755 --- a/link.sh +++ b/link.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/locale_install.sh b/locale_install.sh index 3c4662582..7727a157a 100755 --- a/locale_install.sh +++ b/locale_install.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/locale_uninstall.sh b/locale_uninstall.sh index 49b0c384c..5f2700fa0 100755 --- a/locale_uninstall.sh +++ b/locale_uninstall.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/locales/en_US.msg b/locales/en_US.msg index 895ffef1c..3f6840bc6 100644 --- a/locales/en_US.msg +++ b/locales/en_US.msg @@ -1,5 +1,5 @@ $ $ -$ Copyright (c) 2018-2019 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. $ $ $ All rights reserved. $ $ diff --git a/locales/fr_FR.ISO8859-1.msg b/locales/fr_FR.ISO8859-1.msg index 01a7b26ed..9456c3809 100644 --- a/locales/fr_FR.ISO8859-1.msg +++ b/locales/fr_FR.ISO8859-1.msg @@ -1,5 +1,5 @@ $ $ -$ Copyright (c) 2018-2019 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. $ $ $ All rights reserved. $ $ diff --git a/locales/fr_FR.UTF-8.msg b/locales/fr_FR.UTF-8.msg index 01a7b26ed..9456c3809 100644 --- a/locales/fr_FR.UTF-8.msg +++ b/locales/fr_FR.UTF-8.msg @@ -1,5 +1,5 @@ $ $ -$ Copyright (c) 2018-2019 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. $ $ $ All rights reserved. $ $ diff --git a/locales/pt_PT.ISO-8859-1.msg b/locales/pt_PT.ISO-8859-1.msg index 9f2a34e0b..d8564804c 100644 --- a/locales/pt_PT.ISO-8859-1.msg +++ b/locales/pt_PT.ISO-8859-1.msg @@ -1,5 +1,5 @@ $ $ -$ Copyright (c) 2018-2019 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. $ $ $ All rights reserved. $ $ diff --git a/locales/pt_PT.UTF-8.msg b/locales/pt_PT.UTF-8.msg index 9f2a34e0b..d8564804c 100644 --- a/locales/pt_PT.UTF-8.msg +++ b/locales/pt_PT.UTF-8.msg @@ -1,5 +1,5 @@ $ $ -$ Copyright (c) 2018-2019 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. $ $ $ All rights reserved. $ $ diff --git a/release.sh b/release.sh index aa031a1bc..0a7c39673 100755 --- a/release.sh +++ b/release.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/src/args.c b/src/args.c index a3349557f..225bb727d 100644 --- a/src/args.c +++ b/src/args.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/bc/bc.c b/src/bc/bc.c index d0604eb5b..dcf5b01bd 100644 --- a/src/bc/bc.c +++ b/src/bc/bc.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/bc/lex.c b/src/bc/lex.c index a2e0b200a..f907e221f 100644 --- a/src/bc/lex.c +++ b/src/bc/lex.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/bc/parse.c b/src/bc/parse.c index 9be35a305..75dabfca5 100644 --- a/src/bc/parse.c +++ b/src/bc/parse.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/data.c b/src/data.c index d2b53d5c2..63f2695af 100644 --- a/src/data.c +++ b/src/data.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * @@ -52,7 +52,7 @@ const char dc_sig_msg[] = "\ninterrupt (type \"q\" to exit)\n"; #endif // BC_ENABLE_SIGNALS const char bc_copyright[] = - "Copyright (c) 2018-2019 Gavin D. Howard and contributors\n" + "Copyright (c) 2018-2020 Gavin D. Howard and contributors\n" "Report bugs at: https://github.com/gavinhoward/bc\n\n" "This is free software with ABSOLUTELY NO WARRANTY.\n"; diff --git a/src/dc/dc.c b/src/dc/dc.c index e64f6a0ac..ebcbf630f 100644 --- a/src/dc/dc.c +++ b/src/dc/dc.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/dc/lex.c b/src/dc/lex.c index 6b4ac582e..bd1cb936f 100644 --- a/src/dc/lex.c +++ b/src/dc/lex.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/dc/parse.c b/src/dc/parse.c index fb5a4044d..e710c60f5 100644 --- a/src/dc/parse.c +++ b/src/dc/parse.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/history/history.c b/src/history/history.c index 42372cbf7..12a8425f7 100644 --- a/src/history/history.c +++ b/src/history/history.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/lang.c b/src/lang.c index 625cf48d4..c3389196f 100644 --- a/src/lang.c +++ b/src/lang.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/lex.c b/src/lex.c index 281a176bc..98e2c620a 100644 --- a/src/lex.c +++ b/src/lex.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/main.c b/src/main.c index 27ab77721..5ec7a73d4 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/num.c b/src/num.c index a558a6287..86f4ede00 100644 --- a/src/num.c +++ b/src/num.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/parse.c b/src/parse.c index 2bff1e429..34e1a4d3b 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/program.c b/src/program.c index 295937018..a4b660455 100644 --- a/src/program.c +++ b/src/program.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/read.c b/src/read.c index a60e3ea67..273afcb37 100644 --- a/src/read.c +++ b/src/read.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/vector.c b/src/vector.c index 54cd61295..a0c0e70c3 100644 --- a/src/vector.c +++ b/src/vector.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/src/vm.c b/src/vm.c index 4a5507c3b..efbb2902f 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1,7 +1,7 @@ /* * ***************************************************************************** * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. + * Copyright (c) 2018-2020 Gavin D. Howard and contributors. * * All rights reserved. * diff --git a/tests/afl.py b/tests/afl.py index 5c7c94638..3d81265c6 100755 --- a/tests/afl.py +++ b/tests/afl.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -B # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/all.sh b/tests/all.sh index 22e892f2b..08a306ee3 100755 --- a/tests/all.sh +++ b/tests/all.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/bc/timeconst.sh b/tests/bc/timeconst.sh index 5f5600fef..17e765d15 100755 --- a/tests/bc/timeconst.sh +++ b/tests/bc/timeconst.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/errors.sh b/tests/errors.sh index be87bf322..dd38b5d28 100755 --- a/tests/errors.sh +++ b/tests/errors.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/randmath.py b/tests/randmath.py index d20d94c09..f350ef357 100755 --- a/tests/randmath.py +++ b/tests/randmath.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -B # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/read.sh b/tests/read.sh index 0f505df3b..635291221 100755 --- a/tests/read.sh +++ b/tests/read.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/script.sh b/tests/script.sh index b1dbfe4a5..b8d310799 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/scripts.sh b/tests/scripts.sh index f627638db..00631c385 100755 --- a/tests/scripts.sh +++ b/tests/scripts.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/stdin.sh b/tests/stdin.sh index 5d41e79ae..cfd45805f 100755 --- a/tests/stdin.sh +++ b/tests/stdin.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # diff --git a/tests/test.sh b/tests/test.sh index 6c7a93bd3..8eb2134ce 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2019 Gavin D. Howard and contributors. +# Copyright (c) 2018-2020 Gavin D. Howard and contributors. # # All rights reserved. # From a38469fd93c20d1de3f972c982de3c234000116a Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 14 Jan 2020 22:24:01 +0000 Subject: [PATCH 4/7] Explicit '-std=c99' to avoid ambiguity across different compilers/versions. --- Makefile.in | 2 +- configure.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9d6e8d1f1..041775c05 100644 --- a/Makefile.in +++ b/Makefile.in @@ -140,7 +140,7 @@ BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DVERSION=$(VERSION) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 +CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -std=c99 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) diff --git a/configure.sh b/configure.sh index f5c11a41b..73b3c5d3c 100755 --- a/configure.sh +++ b/configure.sh @@ -652,7 +652,7 @@ if [ "$nls" -ne 0 ]; then flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc -DBC_ENABLE_SIGNALS=$signals" flags="$flags -DBC_ENABLE_HISTORY=$hist" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" - flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" + flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -std=c99" "$HOSTCC" $HOSTCFLAGS $flags -c "src/vm.c" -o "$scriptdir/vm.o" > /dev/null 2>&1 @@ -725,7 +725,7 @@ if [ "$hist" -eq 1 ]; then flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc -DBC_ENABLE_SIGNALS=$signals" flags="$flags -DBC_ENABLE_NLS=$nls" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" - flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" + flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -std=c99" "$HOSTCC" $HOSTCFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 From f022d5dedc841bb1d23fa2e03fdc97a639de700d Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Tue, 14 Jan 2020 22:57:04 +0000 Subject: [PATCH 5/7] Update documentation and prepare for release. --- Makefile.in | 2 +- NEWS.md | 6 ++++++ README.md | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 041775c05..9e719cd72 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 2.5.0 +VERSION = 2.5.5 SRC = %%SRC%% OBJ = %%OBJ%% diff --git a/NEWS.md b/NEWS.md index 90c475e73..b92df2cd7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # News +## 2.5.5 + +This is a production release which addresses portability concerns discovered +in the `bc` build system. No `bc` code was changed. Minor documentation edits +were performed (platform support and copyright year). Solaris SPARC now works. + ## 2.5.0 This is a production release with new translations. No code changed. diff --git a/README.md b/README.md index 52294d6ba..06e1dc554 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ Systems that are known to work: * OpenBSD * NetBSD * Mac OSX +* Solaris Please submit bug reports if this `bc` does not build out of the box on any system besides Windows. If Windows binaries are needed, they can be found at From 8b83e334177701cd2c05fd10090a1f582bd7e9f8 Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 15 Jan 2020 13:56:00 +0000 Subject: [PATCH 6/7] Revert "Explicit '-std=c99' to avoid ambiguity across different compilers/versions." This reverts commit a38469fd93c20d1de3f972c982de3c234000116a. --- Makefile.in | 2 +- configure.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9e719cd72..a11bc2f2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -140,7 +140,7 @@ BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DVERSION=$(VERSION) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -std=c99 +CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) diff --git a/configure.sh b/configure.sh index 73b3c5d3c..f5c11a41b 100755 --- a/configure.sh +++ b/configure.sh @@ -652,7 +652,7 @@ if [ "$nls" -ne 0 ]; then flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc -DBC_ENABLE_SIGNALS=$signals" flags="$flags -DBC_ENABLE_HISTORY=$hist" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" - flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -std=c99" + flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" "$HOSTCC" $HOSTCFLAGS $flags -c "src/vm.c" -o "$scriptdir/vm.o" > /dev/null 2>&1 @@ -725,7 +725,7 @@ if [ "$hist" -eq 1 ]; then flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc -DBC_ENABLE_SIGNALS=$signals" flags="$flags -DBC_ENABLE_NLS=$nls" flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/" - flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -std=c99" + flags="$flags -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600" "$HOSTCC" $HOSTCFLAGS $flags -c "src/history/history.c" -o "$scriptdir/history.o" > /dev/null 2>&1 From a756285f60b2139fc629c3edf230c8b1f9a875ed Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 15 Jan 2020 13:57:24 +0000 Subject: [PATCH 7/7] Comply with versioning policy as per author feedback in PR 27. --- Makefile.in | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index a11bc2f2d..04abc37d3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 2.5.5 +VERSION = 2.5.1 SRC = %%SRC%% OBJ = %%OBJ%% diff --git a/NEWS.md b/NEWS.md index b92df2cd7..02eab7a75 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # News -## 2.5.5 +## 2.5.1 This is a production release which addresses portability concerns discovered in the `bc` build system. No `bc` code was changed. Minor documentation edits