mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-31 12:56:10 +01:00
Compare commits
96
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e6399fe39 | ||
|
|
b362b6b6c8 | ||
|
|
bf0db64e03 | ||
|
|
f7f48005fb | ||
|
|
32d12677ff | ||
|
|
0ab05345fb | ||
|
|
5a5e7883a3 | ||
|
|
a2d45189b9 | ||
|
|
7c5c37ac8f | ||
|
|
f7e6b9f128 | ||
|
|
6c36e5dd0c | ||
|
|
a2f6f2d001 | ||
|
|
2862a33bdd | ||
|
|
6c9dd75283 | ||
|
|
5c4e558ab4 | ||
|
|
c4f53a1adb | ||
|
|
9d3e842358 | ||
|
|
c2e2bfbd9e | ||
|
|
933abe4a19 | ||
|
|
ecec541087 | ||
|
|
e6b96891ef | ||
|
|
82cee749b5 | ||
|
|
0b18e4842c | ||
|
|
0e9fc21ec0 | ||
|
|
9afc16c4e8 | ||
|
|
e91e8b785b | ||
|
|
15b39c1df3 | ||
|
|
4613405fd6 | ||
|
|
4586c4f500 | ||
|
|
9f959a9837 | ||
|
|
fbb71f3a14 | ||
|
|
e87a5dd805 | ||
|
|
78b90c34c3 | ||
|
|
fd02eb5592 | ||
|
|
4967e14ba2 | ||
|
|
eb5a6f5f9f | ||
|
|
35cee6a901 | ||
|
|
60026b0636 | ||
|
|
4fc17862cb | ||
|
|
9b0808259a | ||
|
|
c4530d6e5f | ||
|
|
8a7adde307 | ||
|
|
90e14aa082 | ||
|
|
c106ed3325 | ||
|
|
ae7c74cfa5 | ||
|
|
ab91dd76ff | ||
|
|
e8acfa0be3 | ||
|
|
751971e554 | ||
|
|
23bc592b8f | ||
|
|
798b7b161a | ||
|
|
341d92aef0 | ||
|
|
95e9c54b39 | ||
|
|
575644144d | ||
|
|
35c2729211 | ||
|
|
4d9c4ecf6a | ||
|
|
f936833911 | ||
|
|
37edc07ede | ||
|
|
74176002ff | ||
|
|
dec0bf8096 | ||
|
|
74aa5e2a7b | ||
|
|
882b9f3f22 | ||
|
|
a24b044a1e | ||
|
|
956fb94dd6 | ||
|
|
cf411e5ed3 | ||
|
|
e8043c76e3 | ||
|
|
93b7f9301c | ||
|
|
7f6d09003a | ||
|
|
ee6c7bf50b | ||
|
|
31dcdee20a | ||
|
|
cb8e164fbb | ||
|
|
b74bb7f011 | ||
|
|
d2b7937c2c | ||
|
|
ef280c2e5f | ||
|
|
6cb9cfffa8 | ||
|
|
78b4f77518 | ||
|
|
88fcdcb08a | ||
|
|
fb30987533 | ||
|
|
6e06a07978 | ||
|
|
6b0086795d | ||
|
|
3afa8f08bc | ||
|
|
cd91df3292 | ||
|
|
5f2744d520 | ||
|
|
a3b66c4bf0 | ||
|
|
881ba70c1a | ||
|
|
ebda0be762 | ||
|
|
a7ad643719 | ||
|
|
9880ce0765 | ||
|
|
1ed60133f6 | ||
|
|
b6dc660155 | ||
|
|
a0146592cd | ||
|
|
ebc96321e7 | ||
|
|
e375421e24 | ||
|
|
1aaec1978a | ||
|
|
dfe803fdbc | ||
|
|
ef6b3c5888 | ||
|
|
a8f9845e39 |
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ compute_engine_instance:
|
||||
# gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images
|
||||
platform: freebsd
|
||||
image_project: freebsd-org-cloud-dev
|
||||
image: freebsd-13-5-release-amd64
|
||||
image: freebsd-13-3-release-amd64
|
||||
cpu: 8
|
||||
memory: 8G
|
||||
disk: 40
|
||||
|
||||
@@ -2,7 +2,7 @@ name: Cross-build Kernel
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, 'stable/[1-9][0-9]' ]
|
||||
branches: [ main, 'stable/13' ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
|
||||
@@ -22,4 +22,3 @@ cscope.in.out
|
||||
cscope.out
|
||||
cscope.po.out
|
||||
tags
|
||||
/src.conf
|
||||
+3
-8
@@ -607,10 +607,7 @@ XPATH= ${WORLDTMP}/bin:${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin
|
||||
# When building we want to find the cross tools before the host tools in ${BPATH}.
|
||||
# We also need to add UNIVERSE_TOOLCHAIN_PATH so that we can find the shared
|
||||
# toolchain files (clang, lld, etc.) during make universe/tinderbox
|
||||
STRICTTMPPATH= ${XPATH}:${BPATH}
|
||||
.if defined(UNIVERSE_TOOLCHAIN_PATH)
|
||||
STRICTTMPPATH:=${STRICTTMPPATH}:${UNIVERSE_TOOLCHAIN_PATH}
|
||||
.endif
|
||||
STRICTTMPPATH= ${XPATH}:${BPATH}:${UNIVERSE_TOOLCHAIN_PATH}
|
||||
# We should not be using tools from /usr/bin accidentally since this could cause
|
||||
# the build to break on other systems that don't have that tool. For now we
|
||||
# still allow using the old behaviour (inheriting $PATH) if
|
||||
@@ -785,7 +782,6 @@ TMAKE= \
|
||||
# TOOLS_PREFIX set in BMAKE
|
||||
XMAKE= ${BMAKE} \
|
||||
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
||||
MK_CLANG=${MK_CLANG_BOOTSTRAP} \
|
||||
MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \
|
||||
MK_LLDB=no \
|
||||
MK_LLVM_BINUTILS=no \
|
||||
@@ -1358,7 +1354,7 @@ _sysctl=sysctl
|
||||
.endif
|
||||
|
||||
ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
|
||||
date echo egrep find grep id install \
|
||||
date echo egrep find grep id install ${_install-info} \
|
||||
ln make mkdir mtree mv pwd_mkdb \
|
||||
rm sed services_mkdb sh sort strip ${_sysctl} test true uname wc
|
||||
|
||||
@@ -2711,7 +2707,7 @@ _elftctools= lib/libelftc \
|
||||
.endif
|
||||
|
||||
.if ${MK_CLANG_BOOTSTRAP} != "no"
|
||||
_clang= usr.bin/clang/clang
|
||||
_clang= usr.bin/clang
|
||||
.endif
|
||||
.if ${MK_LLD_BOOTSTRAP} != "no"
|
||||
_lld= usr.bin/clang/lld
|
||||
@@ -2850,7 +2846,6 @@ NXBMAKEARGS+= \
|
||||
MK_DEBUG_FILES=no \
|
||||
MK_HTML=no \
|
||||
MK_LLDB=no \
|
||||
MK_LLVM_LINK_STATIC_LIBRARIES=yes \
|
||||
MK_MAN=no \
|
||||
MK_MAN_UTILS=yes \
|
||||
MK_OFED=no \
|
||||
|
||||
@@ -51,99 +51,6 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20260430: Regenerate trust store
|
||||
OLD_FILES+=usr/share/certs/trusted/Entrust_net_Premium_2048_Secure_Server_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/AffirmTrust_Premium.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Starfield_Class_2_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/GTS_Root_R2.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/GLOBALTRUST_2020.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Secure_Global_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/GlobalSign_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/CommScope_Public_Trust_RSA_Root-01.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Trustwave_Global_ECC_P384_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/SwissSign_Gold_CA_-_G2.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Go_Daddy_Class_2_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/FIRMAPROFESIONAL_CA_ROOT-A_WEB.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Trustwave_Global_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Trustwave_Global_ECC_P256_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/CommScope_Public_Trust_ECC_Root-01.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Entrust_Root_Certification_Authority_-_EC1.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Certigna.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/AffirmTrust_Commercial.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/DigiCert_Assured_ID_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Baltimore_CyberTrust_Root.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/CommScope_Public_Trust_ECC_Root-02.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Entrust_Root_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/AffirmTrust_Premium_ECC.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/CommScope_Public_Trust_RSA_Root-02.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/TeliaSonera_Root_CA_v1.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/QuoVadis_Root_CA_2.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/COMODO_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/SecureTrust_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Comodo_AAA_Services_root.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Entrust_Root_Certification_Authority_-_G2.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/QuoVadis_Root_CA_3.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/DigiCert_High_Assurance_EV_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/certSIGN_ROOT_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/DigiCert_Global_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/AffirmTrust_Networking.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/XRamp_Global_CA_Root.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Security_Communication_RootCA3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/GeoTrust_Primary_Certification_Authority_-_G3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/E-Tugra_Global_Root_CA_ECC_v3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G4.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/EE_Certification_Centre_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/EC-ACC.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/GeoTrust_Universal_CA.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Global_Chambersign_Root_-_2008.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Camerfirma_Global_Chambersign_Root.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G6.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/GeoTrust_Primary_Certification_Authority_-_G2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/TrustCor_RootCert_CA-2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/GeoTrust_Universal_CA_2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Network_Solutions_Certificate_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/thawte_Primary_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/E-Tugra_Global_Root_CA_RSA_v3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/GeoTrust_Primary_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Taiwan_GRCA.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G6.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/SwissSign_Platinum_CA_-_G2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/TrustCor_RootCert_CA-1.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/thawte_Primary_Root_CA_-_G3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Camerfirma_Chambers_of_Commerce_Root.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/SwissSign_Silver_CA_-_G2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/TrustCor_ECA-1.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/SecureSign_RootCA11.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Chambers_of_Commerce_Root_-_2008.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/VeriSign_Universal_Root_Certification_Authority.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/LuxTrust_Global_Root_2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/thawte_Primary_Root_CA_-_G2.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G4.pem
|
||||
|
||||
# 20251006: Remove libnss_tacplus.a (it never should have been installed)
|
||||
OLD_FILES+=usr/lib/libnss_tacplus.a
|
||||
|
||||
# 20250812: Remove a bogus manlink
|
||||
OLD_FILES+=usr/share/man/man3/quota_statfs.3.gz
|
||||
|
||||
# 20250805: Test case renamed
|
||||
OLD_FILES+=usr/tests/usr.bin/xargs/regress.n2147483647.out
|
||||
|
||||
# 20250710: share: Delete bitrotted make_*_driver.sh scripts
|
||||
OLD_FILES+=usr/share/examples/drivers/README
|
||||
OLD_FILES+=usr/share/examples/drivers/make_device_driver.sh
|
||||
OLD_FILES+=usr/share/examples/drivers/make_pseudo_driver.sh
|
||||
OLD_DIRS+=usr/share/examples/drivers
|
||||
|
||||
# 20250524: don't install zoneinfo version
|
||||
OLD_FILES+=usr/share/zoneinfo/version
|
||||
|
||||
# 20250310: caroot bundle updated
|
||||
OLD_FILES+=usr/share/certs/trusted/Entrust_Root_Certification_Authority_-_G4.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/SecureSign_RootCA11.pem
|
||||
@@ -164,10 +71,6 @@ OLD_FILES+=usr/share/certs/blacklisted/Hongkong_Post_Root_CA_1.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Security_Communication_Root_CA.pem
|
||||
OLD_FILES+=usr/share/certs/blacklisted/Trustis_FPS_Root_CA.pem
|
||||
|
||||
# 20250204: sys/vm/stack test symbols moved to /usr/lib/debug
|
||||
OLD_FILES+=usr/tests/sys/vm/stack/.debug/libsoxstack.so.debug
|
||||
OLD_DIRS+=usr/tests/sys/vm/stack/.debug
|
||||
|
||||
# 20241201: new clang import which bumps version from 18 to 19
|
||||
OLD_FILES+=usr/lib/clang/18/include/__clang_cuda_builtin_vars.h
|
||||
OLD_FILES+=usr/lib/clang/18/include/__clang_cuda_cmath.h
|
||||
@@ -1512,22 +1415,6 @@ OLD_FILES+=usr/share/certs/trusted/E-Tugra_Global_Root_CA_ECC_v3.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/E-Tugra_Global_Root_CA_RSA_v3.pem
|
||||
OLD_FILES+=usr/share/certs/trusted/Hongkong_Post_Root_CA_1.pem
|
||||
|
||||
# 20230807: GoogleTest 1.14.0 upgrade.
|
||||
OLD_FILES+=usr/include/private/gmock/gmock-generated-actions.h
|
||||
OLD_FILES+=usr/include/private/gmock/gmock-generated-function-mockers.h
|
||||
OLD_FILES+=usr/include/private/gmock/gmock-generated-matchers.h
|
||||
OLD_FILES+=usr/include/private/gmock/gmock-generated-nice-strict.h
|
||||
OLD_FILES+=usr/include/private/gmock/internal/gmock-generated-internal-utils.h
|
||||
OLD_FILES+=usr/include/private/gtest/internal/gtest-linked_ptr.h
|
||||
OLD_FILES+=usr/include/private/gtest/internal/gtest-param-util-generated.h
|
||||
OLD_FILES+=usr/include/private/gtest/internal/gtest-tuple.h
|
||||
OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-actions_test
|
||||
OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-function-mockers_test
|
||||
OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-internal-utils_test
|
||||
OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-generated-matchers_test
|
||||
OLD_FILES+=usr/tests/lib/googletest/gmock_main/gmock-matchers_test
|
||||
OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-linked-ptr-test
|
||||
|
||||
# 20230806: Removal of support for the VTOC8 partitioning scheme
|
||||
OLD_FILES+=usr/include/sys/disk/vtoc.h
|
||||
OLD_FILES+=usr/include/sys/vtoc.h
|
||||
|
||||
@@ -12,16 +12,139 @@ Items affecting the ports and packages system can be found in
|
||||
/usr/ports/UPDATING. Please read that file before updating system packages
|
||||
and/or ports.
|
||||
|
||||
20260430:
|
||||
13.5-RELEASE-p14 EN-26:11.dhclient
|
||||
|
||||
dhclient(8) lease validation is too strict. [EN-26:11.dhclient]
|
||||
|
||||
20260429:
|
||||
13.5-RELEASE-p13 SA-26:12.dhclient
|
||||
SA-26:13.exec
|
||||
SA-26:14.pf
|
||||
SA-26:15.dhclient
|
||||
SA-26:16.libnv
|
||||
SA-26:17.libnv
|
||||
EN-26:09.tzdata
|
||||
|
||||
Remote code execution via malicious DHCP options. [SA-26:12.dhclient]
|
||||
|
||||
Local privilege escalation via execve(). [SA-26:13.exec]
|
||||
|
||||
pf can overflow the stack parsing crafted SCTP packets. [SA-26:14.pf]
|
||||
|
||||
Remotely triggerable out-of-bounds heap write in dhclient. [SA-26:15.dhclient]
|
||||
|
||||
Stack overflow via select() file descriptor set overflow. [SA-26:16.libnv]
|
||||
|
||||
Heap overflow in libnv. [SA-26:17.libnv]
|
||||
|
||||
Timezone database information update. [EN-26:09.tzdata]
|
||||
|
||||
20260421:
|
||||
13.5-RELEASE-p12 SA-26:10.tty
|
||||
SA-26:11.amd64
|
||||
EN-26:05.vm
|
||||
|
||||
Kernel use-after-free bug in the TIOCNOTTY handler. [SA-26:10.tty]
|
||||
|
||||
Missing large page handling in pmap_pkru_update_range(). [SA-26:11.amd64]
|
||||
|
||||
The page fault handler fails to zero memory. [EN-26:05.vm]
|
||||
|
||||
20260325:
|
||||
13.5-RELEASE-p11 SA-26:08.rpcsec_gss
|
||||
|
||||
Remote code execution via RPCSEC_GSS packet validation. [SA-26:08.rpcsec_gss]
|
||||
|
||||
20260224:
|
||||
13.5-RELEASE-p10 SA-26:04.jail
|
||||
SA-26:05.route
|
||||
|
||||
Jail chroot escape via fd exchange with a different jail. [SA-26:04.jail]
|
||||
|
||||
Local DoS and possible privilege escalation via routing sockets. [SA-26:05.route]
|
||||
|
||||
20260127:
|
||||
13.5-RELEASE-p9 SA-26:01.openssl
|
||||
SA-26:02.jail
|
||||
EN-26:03.vm
|
||||
|
||||
Fix multiple vulnerabilities in OpenSSL. [SA-26:01.openssl]
|
||||
|
||||
Jail escape by a privileged user via nullfs. [SA-26:02.jail]
|
||||
|
||||
The page fault handler fails to zero memory. [EN-26:03.vm]
|
||||
|
||||
20251216:
|
||||
13.5-RELEASE-p8 SA-25:11.ipfw
|
||||
SA-25:12.rtsold
|
||||
|
||||
ipfw denial of service. [SA-25:11.ipfw]
|
||||
|
||||
Remote code execution via ND6 Router Advertisements. [SA-25:12.rtsold]
|
||||
|
||||
20251126:
|
||||
13.5-RELEASE-p7 SA-25:10.unbound
|
||||
|
||||
Fix cache poison in local-unbound service. [SA-25:10.unbound]
|
||||
|
||||
20251022:
|
||||
13.5-RELEASE-p6 SA-25:09.netinet
|
||||
|
||||
SO_REUSEPORT_LB breaks connect(2) for UDP sockets. [SA-25:09.netinet]
|
||||
|
||||
20250930:
|
||||
13.5-RELEASE-p5 EN-25:18.freebsd-update
|
||||
SA-25:08.openssl
|
||||
|
||||
Fix freebsd-update(8) installing libraries in incorrect order. [EN-25:18.freebsd-update]
|
||||
|
||||
Fix multiple vulnerabilities in OpenSSL. [SA-25:08.openssl]
|
||||
|
||||
20250916:
|
||||
13.5-RELEASE-p4 EN-25:15.arm64
|
||||
|
||||
Fix arm64 syscall(2) allows unprivileged user to panic kernel. [EN-25:15.arm64]
|
||||
|
||||
20250808:
|
||||
13.5-RELEASE-p3 SA-25:07.libarchive
|
||||
|
||||
Update libarchive to 3.8.1 to fix integer overflow leading to double
|
||||
free. [SA-25:07.libarchive]
|
||||
|
||||
20250702:
|
||||
13.5-RELEASE-p2 EN-25:09.libc
|
||||
EN-25:10.zfs
|
||||
EN-25:11.ena
|
||||
SA-25:06.xz
|
||||
|
||||
Fix dynamically-loaded C++ libraries crashing at exit [EN-25:09.libc]
|
||||
|
||||
Fix corruption in ZFS replication streams from encrypted datasets [EN-25:10.zfs]
|
||||
|
||||
Fix ena resets and kernel panic on Nitro v4 or newer instances [EN-25:11.ena]
|
||||
|
||||
Fix use-after-free in multi-threaded xz decoder [SA-25:06.xz]
|
||||
|
||||
20250410:
|
||||
13.5-RELEASE-p1 EN-25:04.tzdata
|
||||
EN-25:05.expat
|
||||
EN-25:08.caroot
|
||||
|
||||
Timezone database information update [EN-25:04.tzdata]
|
||||
|
||||
Update expat to 2.7.1 [EN-25:05.expat]
|
||||
|
||||
Root certificate bundle update [EN-25:08.caroot]
|
||||
|
||||
20250311:
|
||||
13.5-RELEASE.
|
||||
|
||||
20250117:
|
||||
The layout of NFS file handles for the cd9660 and ext2fs file systems
|
||||
has changed. An NFS server that exports any of these file systems will
|
||||
need its clients to unmount and remount the exports.
|
||||
|
||||
20250916:
|
||||
If SRCCONF is unset and a file named src.conf is present at
|
||||
the top of the source tree, it will now be used instead of
|
||||
/etc/src.conf.
|
||||
|
||||
20240419:
|
||||
Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have
|
||||
been upgraded to 18.1.6. It is important that you run `make delete-old`
|
||||
|
||||
+9
-9
@@ -227,7 +227,7 @@ main(int argc, char *argv[])
|
||||
* Case (1). Target is not a directory.
|
||||
*/
|
||||
if (argc > 1)
|
||||
errc(1, ENOTDIR, "%s", to.p_path);
|
||||
errx(1, "%s is not a directory", to.p_path);
|
||||
|
||||
/*
|
||||
* Need to detect the case:
|
||||
@@ -250,17 +250,17 @@ main(int argc, char *argv[])
|
||||
type = FILE_TO_FILE;
|
||||
|
||||
if (have_trailing_slash && type == FILE_TO_FILE) {
|
||||
if (r == -1)
|
||||
errc(1, ENOENT, "%s", to.p_path);
|
||||
else
|
||||
errc(1, ENOTDIR, "%s", to.p_path);
|
||||
if (r == -1) {
|
||||
errx(1, "directory %s does not exist",
|
||||
to.p_path);
|
||||
} else
|
||||
errx(1, "%s is not a directory", to.p_path);
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
/*
|
||||
* Case (2). Target is a directory.
|
||||
*/
|
||||
type = FILE_TO_DIR;
|
||||
}
|
||||
|
||||
/*
|
||||
* For DIR_TO_DNE, we could provide copy() with the to_stat we've
|
||||
@@ -368,8 +368,8 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat)
|
||||
base = (p == NULL) ? 0 :
|
||||
(int)(p - curr->fts_path + 1);
|
||||
|
||||
if (strcmp(curr->fts_path + base, "..")
|
||||
== 0)
|
||||
if (!strcmp(&curr->fts_path[base],
|
||||
".."))
|
||||
base += 1;
|
||||
} else
|
||||
base = curr->fts_pathlen;
|
||||
|
||||
@@ -74,7 +74,7 @@ hardlink_body()
|
||||
echo "foo" >foo
|
||||
atf_check cp -l foo bar
|
||||
atf_check -o inline:"foo\n" cat bar
|
||||
atf_check test foo -ef bar
|
||||
atf_check_equal "$(stat -f%d,%i foo)" "$(stat -f%d,%i bar)"
|
||||
}
|
||||
|
||||
atf_test_case hardlink_exists
|
||||
@@ -84,7 +84,7 @@ hardlink_exists_body()
|
||||
echo "bar" >bar
|
||||
atf_check -s not-exit:0 -e match:exists cp -l foo bar
|
||||
atf_check -o inline:"bar\n" cat bar
|
||||
atf_check test ! foo -ef bar
|
||||
atf_check_not_equal "$(stat -f%d,%i foo)" "$(stat -f%d,%i bar)"
|
||||
}
|
||||
|
||||
atf_test_case hardlink_exists_force
|
||||
@@ -94,7 +94,7 @@ hardlink_exists_force_body()
|
||||
echo "bar" >bar
|
||||
atf_check cp -fl foo bar
|
||||
atf_check -o inline:"foo\n" cat bar
|
||||
atf_check test foo -ef bar
|
||||
atf_check_equal "$(stat -f%d,%i foo)" "$(stat -f%d,%i bar)"
|
||||
}
|
||||
|
||||
atf_test_case matching_srctgt
|
||||
@@ -247,7 +247,7 @@ file_is_sparse()
|
||||
|
||||
files_are_equal()
|
||||
{
|
||||
atf_check test ! "$1" -ef "$2"
|
||||
atf_check_not_equal "$(stat -f%d,%i "$1")" "$(stat -f%d,%i "$2")"
|
||||
atf_check cmp "$1" "$2"
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -213,10 +213,7 @@ copy_file(const FTSENT *entp, int dne)
|
||||
if (!use_copy_file_range) {
|
||||
wcount = copy_fallback(from_fd, to_fd);
|
||||
}
|
||||
if (wcount >= 0)
|
||||
wtotal += wcount;
|
||||
else if (errno != EINTR)
|
||||
break;
|
||||
wtotal += wcount;
|
||||
if (info) {
|
||||
info = 0;
|
||||
(void)fprintf(stderr,
|
||||
@@ -224,7 +221,7 @@ copy_file(const FTSENT *entp, int dne)
|
||||
entp->fts_path, to.p_path,
|
||||
cp_pct(wtotal, fs->st_size));
|
||||
}
|
||||
} while (wcount != 0);
|
||||
} while (wcount > 0);
|
||||
if (wcount < 0) {
|
||||
warn("%s", entp->fts_path);
|
||||
rval = 1;
|
||||
|
||||
+4
-4
@@ -31,7 +31,7 @@
|
||||
.\"
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\"
|
||||
.Dd September 1, 2025
|
||||
.Dd February 27, 2023
|
||||
.Dt DATE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -128,7 +128,7 @@ format.
|
||||
Parsing is done using
|
||||
.Xr strptime 3 .
|
||||
.It Fl I Ns Op Ar FMT
|
||||
Use extended
|
||||
Use
|
||||
.St -iso8601
|
||||
output format.
|
||||
.Ar FMT
|
||||
@@ -151,9 +151,9 @@ is
|
||||
.Cm minutes
|
||||
or
|
||||
.Cm seconds ) ,
|
||||
the extended
|
||||
the
|
||||
.St -iso8601
|
||||
format includes the timezone offset.
|
||||
format includes the timezone.
|
||||
.It Fl j
|
||||
Do not try to set the date.
|
||||
This allows you to use the
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
atf_check_same_file()
|
||||
{
|
||||
atf_check test "$1" -ef "$2"
|
||||
atf_check_equal "$(stat -f %d,%i "$1")" "$(stat -f %d,%i "$2")"
|
||||
}
|
||||
|
||||
atf_check_symlink_to()
|
||||
|
||||
+2
-7
@@ -579,7 +579,6 @@ waitcmdloop(struct job *job)
|
||||
freejob(job);
|
||||
else {
|
||||
job->remembered = 0;
|
||||
deljob(job);
|
||||
if (job == bgjob)
|
||||
bgjob = NULL;
|
||||
}
|
||||
@@ -604,7 +603,7 @@ waitcmdloop(struct job *job)
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, job) != -1);
|
||||
} while (dowait(DOWAIT_BLOCK | DOWAIT_SIG, (struct job *)NULL) != -1);
|
||||
|
||||
sig = pendingsig_waitcmd;
|
||||
pendingsig_waitcmd = 0;
|
||||
@@ -1082,7 +1081,6 @@ waitforjob(struct job *jp, int *signaled)
|
||||
#if JOBS
|
||||
int propagate_int = jp->jobctl && jp->foreground;
|
||||
#endif
|
||||
int jobindex;
|
||||
int status;
|
||||
int st;
|
||||
|
||||
@@ -1090,11 +1088,8 @@ waitforjob(struct job *jp, int *signaled)
|
||||
TRACE(("waitforjob(%%%td) called\n", jp - jobtab + 1));
|
||||
while (jp->state == 0)
|
||||
if (dowait(DOWAIT_BLOCK | (Tflag ? DOWAIT_SIG |
|
||||
DOWAIT_SIG_TRAP : 0), jp) == -1) {
|
||||
jobindex = jp - jobtab;
|
||||
DOWAIT_SIG_TRAP : 0), jp) == -1)
|
||||
dotrap();
|
||||
jp = jobtab + jobindex;
|
||||
}
|
||||
#if JOBS
|
||||
if (jp->jobctl) {
|
||||
if (ttyfd >= 0 && tcsetpgrp(ttyfd, rootpid) < 0)
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ extern char optval[NOPTS];
|
||||
extern const char optletter[NSHORTOPTS];
|
||||
#ifdef DEFINE_OPTIONS
|
||||
char optval[NOPTS];
|
||||
const char optletter[NSHORTOPTS] __nonstring = "efIimnsxvVECabupTPh";
|
||||
const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh";
|
||||
static const unsigned char optname[] =
|
||||
"\007errexit"
|
||||
"\006noglob"
|
||||
|
||||
+6
-4
@@ -33,7 +33,7 @@
|
||||
.\"
|
||||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
||||
.\"
|
||||
.Dd March 8, 2025
|
||||
.Dd November 20, 2024
|
||||
.Dt SH 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -240,9 +240,11 @@ If a shell function is executed and its exit status is explicitly
|
||||
tested, all commands of the function are considered to be tested as
|
||||
well.
|
||||
.Pp
|
||||
Note that many commands return non-zero values to convey information other
|
||||
than errors, which can cause unexpected program termination with
|
||||
.Fl e .
|
||||
It is recommended to check for failures explicitly
|
||||
instead of relying on
|
||||
.Fl e
|
||||
because it tends to behave in unexpected ways,
|
||||
particularly in larger scripts.
|
||||
.It Fl f Li noglob
|
||||
Disable pathname expansion.
|
||||
.It Fl h Li trackall
|
||||
|
||||
@@ -186,6 +186,5 @@ ${PACKAGE}FILES+= wait7.0
|
||||
${PACKAGE}FILES+= wait8.0
|
||||
${PACKAGE}FILES+= wait9.127
|
||||
${PACKAGE}FILES+= wait10.0
|
||||
${PACKAGE}FILES+= wait11.0
|
||||
|
||||
.include <bsd.test.mk>
|
||||
@@ -1,6 +0,0 @@
|
||||
sleep 3 | sleep 2 &
|
||||
sleep 3 &
|
||||
kill %1
|
||||
wait %1
|
||||
r=$?
|
||||
[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = TERM ]
|
||||
@@ -19,7 +19,6 @@ ${PACKAGE}FILES+= bg10.0 bg10.0.stdout
|
||||
${PACKAGE}FILES+= bg11.0
|
||||
${PACKAGE}FILES+= bg12.0
|
||||
${PACKAGE}FILES+= bg13.0
|
||||
${PACKAGE}FILES+= bg14.0
|
||||
${PACKAGE}FILES+= env1.0
|
||||
${PACKAGE}FILES+= fork1.0
|
||||
${PACKAGE}FILES+= fork2.0
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
T=`mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXXXX`
|
||||
trap 'rm -rf "$T"' 0
|
||||
cd "$T" || exit 3
|
||||
mkfifo fifo1 || exit 3
|
||||
set -T
|
||||
trap "for i in 1 2 3 4; do sleep 1 & done" USR1
|
||||
sleep 1 &
|
||||
{ kill -USR1 "$$"; echo .; } >fifo1 &
|
||||
(read dummy <fifo1)
|
||||
+1
-1
@@ -117,7 +117,7 @@ enum token {
|
||||
#define TOKEN_TYPE(token) ((token) & 0xff00)
|
||||
|
||||
static const struct t_op {
|
||||
char op_text[2] __nonstring;
|
||||
char op_text[2];
|
||||
short op_num;
|
||||
} ops1[] = {
|
||||
{"=", STREQ},
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
.\" CDDL HEADER END
|
||||
.\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 8, 2025
|
||||
.Dd September 7, 2021
|
||||
.Dt DTRACE 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -517,18 +515,7 @@ option is not specified,
|
||||
.Nm
|
||||
does not permit the compilation or enabling of a D program that contains
|
||||
destructive actions.
|
||||
.Pp
|
||||
Set the
|
||||
.Va security.bsd.allow_destructive_dtrace
|
||||
.Xr loader 8
|
||||
tunable
|
||||
to
|
||||
.Ql 0
|
||||
to disallow the possibility of enabling destructive actions system-wide at any point at all.
|
||||
Any attempts to enable destructive actions will cause
|
||||
.Nm
|
||||
to exit with a runtime error.
|
||||
.It Fl x Ar arg Ns Op = Ns Ar value
|
||||
.It Fl x Ar arg Op Ns = Ns value
|
||||
Enable or modify a DTrace runtime option or D compiler option.
|
||||
Boolean options are enabled by specifying their name.
|
||||
Options with values are set by separating the option name and value with an
|
||||
@@ -608,52 +595,6 @@ Same as the
|
||||
flag.
|
||||
.It Sy dynvarsize Ns = Ns Ar size
|
||||
Size of the dynamic variable space.
|
||||
.Sm off
|
||||
.It Sy evaltime = Cm exec | preinit | postinit | main
|
||||
.Sm on
|
||||
Process create mode.
|
||||
When using
|
||||
.Fl c Ar cmd
|
||||
to start a command,
|
||||
.Nm
|
||||
will first stop the newly started
|
||||
.Ar cmd ,
|
||||
evaluate the
|
||||
.Xr d 7
|
||||
program,
|
||||
and then resume the
|
||||
.Ar cmd .
|
||||
The
|
||||
.Cm evaltime
|
||||
option controls the exact moment when this happens.
|
||||
.Pp
|
||||
The following table describes supported modes.
|
||||
.Bl -column -offset indent "postinit" "D Program Evaluation Time"
|
||||
.It Sy Mode Ta Sy D Program Evaluation Time
|
||||
.It Cm exec Ta
|
||||
Right at the first instruction of the command
|
||||
.Ar cmd
|
||||
execution.
|
||||
.It Cm preinit Ta
|
||||
Before
|
||||
.Xr elf 5 Ap s
|
||||
.Dq .init
|
||||
sections.
|
||||
.It Cm postinit Ta
|
||||
After
|
||||
.Xr elf 5 Ap s
|
||||
.Dq .init
|
||||
sections.
|
||||
Default on
|
||||
.Fx .
|
||||
.It Cm main Ta
|
||||
Before the first instruction of the
|
||||
.Fn main
|
||||
function.
|
||||
.El
|
||||
.Pp
|
||||
Usually, there is no reason to change the default mode,
|
||||
but it might be handy in situations such as shared library tracing.
|
||||
.It Sy flowindent
|
||||
Turn on flow indentation.
|
||||
Same as the
|
||||
@@ -836,14 +777,6 @@ command line to define a set of macro variables and so forth).
|
||||
The additional arguments can be used in D programs specified using the
|
||||
.Fl s
|
||||
option or on the command line.
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width 'DTRACE_DEBUG'
|
||||
.It Ev DTRACE_DEBUG
|
||||
When defined,
|
||||
.Nm
|
||||
will output debug log messages to
|
||||
.Xr stderr 4 .
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /boot/dtrace.dof -compact
|
||||
.It Pa /boot/dtrace.dof
|
||||
@@ -868,40 +801,15 @@ failed or that the specified request could not be satisfied.
|
||||
.It 2
|
||||
Invalid command line options or arguments were specified.
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
.Bl -diag
|
||||
.It dtrace: could not enable tracing: Permission denied
|
||||
This can happen when
|
||||
.Nm
|
||||
fails to enable destructive actions because
|
||||
.Va security.bsd.allow_destructive_dtrace
|
||||
is set to
|
||||
.Ql 0
|
||||
in
|
||||
.Xr loader.conf 5 .
|
||||
.El
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
utility first appeared in
|
||||
.Fx 7.1 .
|
||||
.Sh SEE ALSO
|
||||
.Xr cpp 1 ,
|
||||
.Xr dtrace_audit 4 ,
|
||||
.Xr dtrace_callout_execute 4 ,
|
||||
.Xr dtrace_fbt 4 ,
|
||||
.Xr dtrace_io 4 ,
|
||||
.Xr dtrace_ip 4 ,
|
||||
.Xr dtrace_lockstat 4 ,
|
||||
.Xr dtrace_proc 4 ,
|
||||
.Xr dtrace_sched 4 ,
|
||||
.Xr dtrace_sctp 4 ,
|
||||
.Xr dtrace_tcp 4 ,
|
||||
.Xr dtrace_udp 4 ,
|
||||
.Xr dtrace_udplite 4 ,
|
||||
.Xr dtrace_vfs 4 ,
|
||||
.Xr elf 5 ,
|
||||
.Xr SDT 9
|
||||
.Rs
|
||||
.%T Solaris Dynamic Tracing Guide
|
||||
.Re
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
utility first appeared in
|
||||
.Fx 7.1 .
|
||||
@@ -38,6 +38,9 @@
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#ifdef illumos
|
||||
#include <synch.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
#include "barrier.h"
|
||||
@@ -46,7 +49,12 @@ void
|
||||
barrier_init(barrier_t *bar, int nthreads)
|
||||
{
|
||||
pthread_mutex_init(&bar->bar_lock, NULL);
|
||||
pthread_cond_init(&bar->bar_cv, NULL);
|
||||
#ifdef illumos
|
||||
sema_init(&bar->bar_sem, 0, USYNC_THREAD, NULL);
|
||||
#else
|
||||
sem_init(&bar->bar_sem, 0, 0);
|
||||
#endif
|
||||
|
||||
bar->bar_numin = 0;
|
||||
bar->bar_nthr = nthreads;
|
||||
}
|
||||
@@ -57,14 +65,26 @@ barrier_wait(barrier_t *bar)
|
||||
pthread_mutex_lock(&bar->bar_lock);
|
||||
|
||||
if (++bar->bar_numin < bar->bar_nthr) {
|
||||
pthread_cond_wait(&bar->bar_cv, &bar->bar_lock);
|
||||
pthread_mutex_unlock(&bar->bar_lock);
|
||||
#ifdef illumos
|
||||
sema_wait(&bar->bar_sem);
|
||||
#else
|
||||
sem_wait(&bar->bar_sem);
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
|
||||
} else {
|
||||
int i;
|
||||
|
||||
/* reset for next use */
|
||||
bar->bar_numin = 0;
|
||||
pthread_cond_broadcast(&bar->bar_cv);
|
||||
for (i = 1; i < bar->bar_nthr; i++)
|
||||
#ifdef illumos
|
||||
sema_post(&bar->bar_sem);
|
||||
#else
|
||||
sem_post(&bar->bar_sem);
|
||||
#endif
|
||||
pthread_mutex_unlock(&bar->bar_lock);
|
||||
|
||||
return (1);
|
||||
|
||||
@@ -33,7 +33,12 @@
|
||||
* APIs for the barrier synchronization primitive.
|
||||
*/
|
||||
|
||||
#include <pthread.h>
|
||||
#ifdef illumos
|
||||
#include <synch.h>
|
||||
#else
|
||||
#include <semaphore.h>
|
||||
typedef sem_t sema_t;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -43,7 +48,7 @@ typedef struct barrier {
|
||||
pthread_mutex_t bar_lock; /* protects bar_numin */
|
||||
int bar_numin; /* current number of waiters */
|
||||
|
||||
pthread_cond_t bar_cv; /* where everyone waits */
|
||||
sema_t bar_sem; /* where everyone waits */
|
||||
int bar_nthr; /* # of waiters to trigger release */
|
||||
} barrier_t;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# License
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard <gavin@gavinhoward.com>
|
||||
Copyright (c) 2018-2024 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-2025 Gavin D. Howard <gavin@gavinhoward.com>
|
||||
Copyright (c) 2018-2024 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
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
# 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/
|
||||
+262
-21
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
# 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:
|
||||
@@ -38,8 +38,6 @@ GENDIR = $(ROOTDIR)/gen
|
||||
|
||||
BUILDDIR = %%BUILDDIR%%
|
||||
|
||||
VERSION = %%VERSION%%
|
||||
|
||||
SRC = %%SRC%%
|
||||
OBJ = %%OBJ%%
|
||||
GCDA = %%GCDA%%
|
||||
@@ -101,16 +99,17 @@ 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
|
||||
|
||||
GENERATE_TESTS = %%GENERATE_TESTS%%
|
||||
PROBLEMATIC_TESTS = %%PROBLEMATIC_TESTS%%
|
||||
BCL_TEST = $(BIN)/$(BCL)
|
||||
BCL_TEST_C = $(TESTSDIR)/$(BCL).c
|
||||
|
||||
MANUALS = manuals
|
||||
BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1
|
||||
@@ -153,11 +152,11 @@ BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%%
|
||||
BC_ENABLE_NLS = %%NLS%%
|
||||
BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%%
|
||||
|
||||
BC_ENABLE_AFL = 0
|
||||
BC_ENABLE_OSSFUZZ = 0
|
||||
BC_ENABLE_MEMCHECK = 0
|
||||
BC_ENABLE_AFL = %%FUZZ%%
|
||||
BC_ENABLE_OSSFUZZ = %%OSSFUZZ%%
|
||||
BC_ENABLE_MEMCHECK = %%MEMCHECK%%
|
||||
|
||||
LIB_FUZZING_ENGINE = 0
|
||||
LIB_FUZZING_ENGINE = %%LIB_FUZZING_ENGINE%%
|
||||
|
||||
BC_DEFAULT_BANNER = %%BC_DEFAULT_BANNER%%
|
||||
BC_DEFAULT_SIGINT_RESET = %%BC_DEFAULT_SIGINT_RESET%%
|
||||
@@ -190,6 +189,10 @@ 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)
|
||||
@@ -215,7 +218,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 = -DVERSION=$(VERSION) $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ)
|
||||
CPPFLAGS = $(CPPFLAGS9) -DBC_ENABLE_OSSFUZZ=$(BC_ENABLE_OSSFUZZ)
|
||||
CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%%
|
||||
LDFLAGS = %%LDFLAGS%%
|
||||
|
||||
@@ -290,10 +293,236 @@ 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
|
||||
@@ -330,25 +559,37 @@ clean_config: clean clean_benchmarks
|
||||
@$(RM) -f compile_commands.json
|
||||
@$(RM) -f $(BCL_PC)
|
||||
|
||||
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_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)
|
||||
|
||||
clean_tests: clean clean_config
|
||||
clean_tests: clean clean_config clean_coverage
|
||||
@printf 'Cleaning test files...\n'
|
||||
@$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS)
|
||||
@$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS)
|
||||
@$(RM) -f $(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
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
# 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
|
||||
@@ -1610,4 +1588,3 @@ not thoroughly tested.
|
||||
[20]: https://github.com/apjanke/ronn-ng
|
||||
[21]: https://pandoc.org/
|
||||
[22]: ./scripts/locale_uninstall.sh
|
||||
[23]: ./MAINTENANCE-TERMS.md
|
||||
@@ -1,6 +1,6 @@
|
||||
# Notice
|
||||
|
||||
Copyright 2018-2025 Gavin D. Howard and contributors.
|
||||
Copyright 2018-2024 Gavin D. Howard and contributors.
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
+4
-17
@@ -1,7 +1,9 @@
|
||||
# `bc`
|
||||
|
||||
***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: 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 to [https://git.gavinhoward.com/][20] for
|
||||
[these reasons][21], though GitHub will remain a mirror.***
|
||||
@@ -280,12 +282,6 @@ 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.
|
||||
@@ -436,8 +432,6 @@ 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`:
|
||||
@@ -475,16 +469,12 @@ 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:
|
||||
|
||||
@@ -526,6 +516,3 @@ 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 +0,0 @@
|
||||
7.1.0
|
||||
@@ -1,402 +0,0 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
*
|
||||
* 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`."
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,575 +0,0 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
*
|
||||
* 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;
|
||||
@@ -1,9 +1,6 @@
|
||||
-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
|
||||
|
||||
+455
-26
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
# 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:
|
||||
@@ -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] \\\n'
|
||||
printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\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,6 +83,10 @@ 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'
|
||||
@@ -129,6 +133,8 @@ usage() {
|
||||
printf ' Installs all locales, regardless of how many are on the system. This\n'
|
||||
printf ' option is useful for package maintainers who want to make sure that\n'
|
||||
printf ' a package contains all of the locales that end users might need.\n'
|
||||
printf ' -m, --enable-memcheck\n'
|
||||
printf ' Enable memcheck mode, to ensure no memory leaks. For development only.\n'
|
||||
printf ' -M, --disable-man-pages\n'
|
||||
printf ' Disable installing manpages.\n'
|
||||
printf ' -N, --disable-nls\n'
|
||||
@@ -166,9 +172,17 @@ 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'
|
||||
@@ -240,12 +254,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 a\n'
|
||||
printf ' PC_PATH The location to install pkg-config files to. Must be an\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 prepend to the executable names, used to not\n'
|
||||
printf ' EXECPREFIX The prefix to append 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"
|
||||
@@ -468,7 +482,7 @@ find_src_files() {
|
||||
}
|
||||
|
||||
# This function generates a list of files to go into the Makefile. It generates
|
||||
# the list of object files.
|
||||
# the list of object files, as well as the list of test coverage files.
|
||||
#
|
||||
# @param contents The contents of the Makefile template to put the list of
|
||||
# files into.
|
||||
@@ -489,6 +503,8 @@ 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" \
|
||||
@@ -505,9 +521,151 @@ 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"
|
||||
@@ -552,6 +710,7 @@ predefined_build() {
|
||||
BSD)
|
||||
bc_only=0
|
||||
dc_only=0
|
||||
coverage=0
|
||||
debug=0
|
||||
optimization="3"
|
||||
hist=1
|
||||
@@ -564,6 +723,11 @@ 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
|
||||
@@ -580,6 +744,7 @@ predefined_build() {
|
||||
GNU)
|
||||
bc_only=0
|
||||
dc_only=0
|
||||
coverage=0
|
||||
debug=0
|
||||
optimization="3"
|
||||
hist=1
|
||||
@@ -592,6 +757,11 @@ 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
|
||||
@@ -607,10 +777,10 @@ predefined_build() {
|
||||
|
||||
GDH)
|
||||
CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories"
|
||||
CFLAGS="$CFLAGS -Wno-unknown-warning-option -Wno-switch-default -Wno-pre-c11-compat"
|
||||
CFLAGS="$CFLAGS -Werror -pedantic -std=c11"
|
||||
CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11"
|
||||
bc_only=0
|
||||
dc_only=0
|
||||
coverage=0
|
||||
debug=0
|
||||
optimization="3"
|
||||
hist=1
|
||||
@@ -623,6 +793,11 @@ 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
|
||||
@@ -638,10 +813,10 @@ predefined_build() {
|
||||
|
||||
DBG)
|
||||
CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories"
|
||||
CFLAGS="$CFLAGS -Wno-unknown-warning-option -Wno-switch-default -Wno-pre-c11-compat"
|
||||
CFLAGS="$CFLAGS -Werror -pedantic -std=c11"
|
||||
CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11"
|
||||
bc_only=0
|
||||
dc_only=0
|
||||
coverage=0
|
||||
debug=1
|
||||
optimization="0"
|
||||
hist=1
|
||||
@@ -654,6 +829,11 @@ 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
|
||||
@@ -672,12 +852,36 @@ 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).
|
||||
# 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).
|
||||
bc_only=0
|
||||
dc_only=0
|
||||
coverage=0
|
||||
karatsuba_len=32
|
||||
debug=0
|
||||
hist=1
|
||||
@@ -691,6 +895,11 @@ 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
|
||||
|
||||
@@ -711,12 +920,13 @@ 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:lMNO:p:PrS:s:T-" opt; do
|
||||
while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" 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 ;;
|
||||
@@ -730,6 +940,7 @@ while getopts "abBcdDeEfgGhHik:lMNO:p:PrS:s:T-" 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" ;;
|
||||
@@ -738,7 +949,11 @@ while getopts "abBcdDeEfgGhHik:lMNO:p:PrS:s:T-" 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#--}"
|
||||
@@ -748,6 +963,7 @@ while getopts "abBcdDeEfgGhHik:lMNO:p:PrS:s:T-" 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" ;;
|
||||
@@ -861,20 +1077,27 @@ while getopts "abBcdDeEfgGhHik:lMNO:p:PrS:s:T-" 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* | debug*)
|
||||
help* | bc-only* | dc-only* | coverage* | 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-history*)
|
||||
disable-generated-tests* | disable-history*)
|
||||
usage "No arg allowed for --$arg option" ;;
|
||||
disable-man-pages* | disable-nls* | disable-strip*)
|
||||
usage "No arg allowed for --$arg option" ;;
|
||||
disable-problematic-tests*)
|
||||
usage "No arg allowed for --$arg option" ;;
|
||||
install-all-locales*)
|
||||
enable-fuzz-mode* | enable-test-timing* | enable-valgrind*)
|
||||
usage "No arg allowed for --$arg option" ;;
|
||||
enable-memcheck* | install-all-locales*)
|
||||
usage "No arg allowed for --$arg option" ;;
|
||||
enable-editline* | enable-readline*)
|
||||
usage "No arg allowed for --$arg option" ;;
|
||||
@@ -998,7 +1221,33 @@ 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"
|
||||
@@ -1025,6 +1274,9 @@ 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"
|
||||
@@ -1040,6 +1292,10 @@ 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"
|
||||
@@ -1047,6 +1303,7 @@ elif [ "$bc_only" -eq 1 ]; then
|
||||
|
||||
default_target="\$(BC_EXEC)"
|
||||
second_target="\$(DC_EXEC)"
|
||||
tests="test_bc timeconst"
|
||||
|
||||
elif [ "$dc_only" -eq 1 ]; then
|
||||
|
||||
@@ -1061,19 +1318,36 @@ 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"
|
||||
|
||||
else
|
||||
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
|
||||
|
||||
executables="bc and dc"
|
||||
# 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"
|
||||
@@ -1085,6 +1359,38 @@ 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="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
|
||||
dc=1
|
||||
|
||||
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"
|
||||
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="$default_target_prereqs"
|
||||
@@ -1093,6 +1399,18 @@ 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
|
||||
|
||||
@@ -1111,6 +1429,26 @@ 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=""
|
||||
@@ -1229,7 +1567,7 @@ if [ "$nls" -ne 0 ]; then
|
||||
printf 'NLS works.\n\n'
|
||||
|
||||
printf 'Testing gencat...\n'
|
||||
gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" 2>&1
|
||||
gencat "./en_US.cat" "$scriptdir/locales/en_US.msg" > /dev/null
|
||||
|
||||
err="$?"
|
||||
|
||||
@@ -1334,10 +1672,26 @@ else
|
||||
|
||||
fi
|
||||
|
||||
if [ "$hist" -eq 0 ]; then
|
||||
# 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'"
|
||||
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"
|
||||
@@ -1441,7 +1795,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_PREREQS=" clean_gen clean_coverage"
|
||||
|
||||
if [ -z "${GEN_HOST+set}" ]; then
|
||||
GEN_HOST=1
|
||||
@@ -1449,6 +1803,7 @@ 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
|
||||
|
||||
@@ -1493,7 +1848,9 @@ else
|
||||
headers="$headers \$(DC_HEADERS)"
|
||||
fi
|
||||
|
||||
version=$(cat "$scriptdir/VERSION.txt" | head -n1)
|
||||
# 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 }' -)
|
||||
|
||||
if [ "$library" -ne 0 ]; then
|
||||
|
||||
@@ -1523,6 +1880,14 @@ 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"
|
||||
@@ -1544,6 +1909,10 @@ 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
|
||||
@@ -1552,6 +1921,14 @@ 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.
|
||||
@@ -1572,6 +1949,7 @@ 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'
|
||||
@@ -1668,11 +2046,26 @@ 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")
|
||||
|
||||
@@ -1680,6 +2073,10 @@ 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")
|
||||
@@ -1702,6 +2099,8 @@ 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")
|
||||
@@ -1727,14 +2126,22 @@ 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")
|
||||
|
||||
@@ -1762,6 +2169,28 @@ 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -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://github.com/gavinhoward/bc/tree/%s/manuals/bc/%s.1.md .
|
||||
https://git.gavinhoward.com/gavin/bc/src/tag/%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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -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://github.com/gavinhoward/bc/tree/%s/manuals/dc/%s.1.md .
|
||||
at https://git.gavinhoward.com/gavin/bc/src/tag/%s/manuals/bc/%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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
+87
-62
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -444,77 +444,108 @@ 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 r,p,s,m[]
|
||||
auto s,t,m[],n[]
|
||||
a=abs(a)$
|
||||
b=abs(b)$
|
||||
r=0
|
||||
p=1
|
||||
s=scale
|
||||
scale=0
|
||||
while(a&&b) {
|
||||
a=divmod(a,2,m[])
|
||||
if(m[0]){
|
||||
b=divmod(b,2,m[])
|
||||
if(m[0])r+=p
|
||||
}else b/=2
|
||||
p*=2
|
||||
if(b>a){
|
||||
t=b
|
||||
b=a
|
||||
a=t
|
||||
}
|
||||
scale=s
|
||||
return r
|
||||
}
|
||||
define bor(a,b){
|
||||
auto r,p,s,m[]
|
||||
a=abs(a)$
|
||||
b=abs(b)$
|
||||
r=0
|
||||
p=1
|
||||
s=scale
|
||||
scale=0
|
||||
while(a||b){
|
||||
a=divmod(a,2,m[])
|
||||
if(!m[0])b=divmod(b,2,m[])
|
||||
else b/=2
|
||||
if(m[0])r+=p
|
||||
p*=2
|
||||
}
|
||||
scale=s
|
||||
return r
|
||||
}
|
||||
define bxor(a,b){
|
||||
auto r,p,s,m[],n[]
|
||||
a=abs(a)$
|
||||
b=abs(b)$
|
||||
r=0
|
||||
p=1
|
||||
s=scale
|
||||
scale=0
|
||||
while(a||b){
|
||||
t=1
|
||||
while(b){
|
||||
a=divmod(a,2,m[])
|
||||
b=divmod(b,2,n[])
|
||||
if(m[0]+n[0]==1)r+=p
|
||||
p*=2
|
||||
t*=2
|
||||
t+=(m[0]&&n[0])
|
||||
}
|
||||
scale=s
|
||||
return r
|
||||
return bunrev(t)
|
||||
}
|
||||
define bor(a,b){
|
||||
auto s,t,m[],n[]
|
||||
a=abs(a)$
|
||||
b=abs(b)$
|
||||
if(b>a){
|
||||
t=b
|
||||
b=a
|
||||
a=t
|
||||
}
|
||||
s=scale
|
||||
scale=0
|
||||
t=1
|
||||
while(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]
|
||||
}
|
||||
scale=s
|
||||
return bunrev(t)
|
||||
}
|
||||
define bxor(a,b){
|
||||
auto s,t,m[],n[]
|
||||
a=abs(a)$
|
||||
b=abs(b)$
|
||||
if(b>a){
|
||||
t=b
|
||||
b=a
|
||||
a=t
|
||||
}
|
||||
s=scale
|
||||
scale=0
|
||||
t=1
|
||||
while(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]
|
||||
}
|
||||
scale=s
|
||||
return bunrev(t)
|
||||
}
|
||||
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 r,p,s,t,m[]
|
||||
auto s,t,m[]
|
||||
s=scale
|
||||
scale=0
|
||||
r=2^(abs(n)$*8)
|
||||
x=abs(x)$%r+r
|
||||
r=0
|
||||
p=1
|
||||
t=2^(abs(n)$*8)
|
||||
x=abs(x)$%t+t
|
||||
t=1
|
||||
while(x!=1){
|
||||
x=divmod(x,2,m[])
|
||||
if(!m[0])r+=p
|
||||
p*=2
|
||||
t*=2
|
||||
t+=!m[0]
|
||||
}
|
||||
scale=s
|
||||
return r
|
||||
return bunrev(t)
|
||||
}
|
||||
define bnot8(x){return bnotn(x,1)}
|
||||
define bnot16(x){return bnotn(x,2)}
|
||||
@@ -522,19 +553,13 @@ 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 a,s,m[]
|
||||
auto s,t,m[]
|
||||
s=scale
|
||||
scale=0
|
||||
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]
|
||||
}
|
||||
t=2^(abs(n)$*8)
|
||||
x=abs(x)$%t+t
|
||||
scale=s
|
||||
return a
|
||||
return bunrev(x)
|
||||
}
|
||||
define brev8(x){return brevn(x,1)}
|
||||
define brev16(x){return brevn(x,2)}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -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-2025 Gavin D. Howard and contributors.\n"
|
||||
"// Copyright (c) 2018-2024 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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
# 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:
|
||||
@@ -96,7 +96,7 @@ if [ -n "$remove_tabs" ]; then
|
||||
fi
|
||||
|
||||
cat<<EOF
|
||||
// Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
// Copyright (c) 2018-2024 Gavin D. Howard and contributors.
|
||||
// Licensed under the 2-clause BSD license.
|
||||
// *** AUTOMATICALLY GENERATED FROM ${input}. DO NOT MODIFY. ***
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -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) \
|
||||
((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))
|
||||
((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))
|
||||
|
||||
/**
|
||||
* Returns true if token @a i is a token that belongs in an expression.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -120,6 +120,30 @@ 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -533,10 +533,6 @@ 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
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -145,9 +145,6 @@ 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.
|
||||
@@ -210,16 +207,11 @@ 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, nops) \
|
||||
do \
|
||||
{ \
|
||||
bc_vec_npopAt(&(p)->results, (nops), \
|
||||
(p)->results.len - ((p)->nresults + nops)); \
|
||||
p->nresults = 0; \
|
||||
} \
|
||||
while (0)
|
||||
#define bc_program_retire(p, nres, nops) \
|
||||
(bc_vec_npopAt(&(p)->results, (nops), (p)->results.len - (nres + nops)))
|
||||
|
||||
#if DC_ENABLED
|
||||
|
||||
|
||||
@@ -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-2025 Gavin D. Howard and contributors.
|
||||
* Copyright (c) 2018-2024 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -683,7 +683,12 @@ 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
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* *****************************************************************************
|
||||
*
|
||||
* 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
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
* 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:
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
#endif // BC_ENABLE_NLS
|
||||
|
||||
#include <version.h>
|
||||
#include <status.h>
|
||||
#include <num.h>
|
||||
#include <lex.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
$ $
|
||||
$ SPDX-License-Identifier: BSD-2-Clause
|
||||
$ $
|
||||
$ Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
$ 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:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -2109,6 +2109,17 @@ 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
|
||||
@@ -2932,7 +2943,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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -1766,6 +1766,16 @@ 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**,
|
||||
@@ -2511,7 +2521,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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -2109,6 +2109,17 @@ 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
|
||||
@@ -2905,7 +2916,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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -1766,6 +1766,16 @@ 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**,
|
||||
@@ -2485,7 +2495,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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -2109,6 +2109,17 @@ 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
|
||||
@@ -2899,7 +2910,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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
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:
|
||||
@@ -1766,6 +1766,16 @@ 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**,
|
||||
@@ -2477,7 +2487,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://github.com/gavinhoward/bc .
|
||||
No other bugs are known. Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
|
||||
# AUTHORS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2018-2025 Gavin D. Howard and contributors.
|
||||
.\" 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:
|
||||
@@ -2109,6 +2109,17 @@ 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
|
||||
@@ -2926,7 +2937,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://github.com/gavinhoward/bc .
|
||||
Report bugs at https://git.gavinhoward.com/gavin/bc .
|
||||
.SH AUTHORS
|
||||
Gavin D. Howard \c
|
||||
.MT [email protected]
|
||||
|
||||
Loaded 100 of 2832 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user