Upgrade to version 3.1.6

This upgrade addresses one (benign) compiler warning when building with
LLVM-12.
This commit is contained in:
Stefan Eßer 2020-10-01 15:45:07 +00:00
commit d213476d1c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366318
7 changed files with 20 additions and 6 deletions

View file

@ -29,7 +29,7 @@
#
.POSIX:
VERSION = 3.1.5
VERSION = 3.1.6
SRC = %%SRC%%
OBJ = %%OBJ%%

View file

@ -1,5 +1,13 @@
# News
## 3.1.6
This is a production release that fixes a new warning from Clang 12 for FreeBSD
and also removes some possible undefined behavior found by UBSan that compilers
did not seem to take advantage of.
Users do ***NOT*** need to upgrade, if they do not want to.
## 3.1.5
This is a production release that fixes the Chinese locales (which caused `bc`

View file

@ -173,6 +173,10 @@ extern const BcParseNext bc_parse_next_elem;
extern const BcParseNext bc_parse_next_for;
extern const BcParseNext bc_parse_next_read;
#else // BC_ENABLED
#define BC_PARSE_NO_EXEC(p) (0)
#endif // BC_ENABLED
#endif // BC_BC_H

View file

@ -383,6 +383,7 @@ build_set() {
clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral"
clang_flags="$clang_flags -Wno-cast-align -Wno-missing-noreturn -Wno-disabled-macro-expansion"
clang_flags="$clang_flags -Wno-unreachable-code -Wno-unreachable-code-return"
clang_flags="$clang_flags -Wno-implicit-fallthrough"
gcc_flags="-Wno-maybe-uninitialized -Wno-clobbered"
cflags="-Wall -Wextra -Werror -pedantic -Wno-conditional-uninitialized"

View file

@ -141,8 +141,8 @@ const char* const bc_err_msgs[] = {
"empty expression",
"bad print statement",
"bad function definition",
"bad assignment: left side must be scale, ibase, "
"obase, seed, last, var, or array element",
("bad assignment: left side must be scale, ibase, "
"obase, seed, last, var, or array element"),
"no auto variable found",
"function parameter or auto \"%s%s\" already exists",
"block end cannot be found",

View file

@ -1457,7 +1457,8 @@ static void bc_num_parseDecimal(BcNum *restrict n, const char *restrict val) {
for (i = 0; i < len && (zero = (val[i] == '0' || val[i] == '.')); ++i);
n->scale = (size_t) (rdx * ((val + len) - (ptr + 1)));
n->scale = (size_t) (rdx * (((uintptr_t) (val + len)) -
(((uintptr_t) ptr) + 1)));
n->rdx = BC_NUM_RDX(n->scale);
i = len - (ptr == val ? 0 : i) - rdx;
@ -1656,7 +1657,7 @@ static void bc_num_printDecimal(const BcNum *restrict n) {
memset(buffer, 0, BC_BASE_DIGS * sizeof(size_t));
for (j = 0; n9 && j < BC_BASE_DIGS; ++j) {
buffer[j] = n9 % BC_BASE;
buffer[j] = ((size_t) n9) % BC_BASE;
n9 /= BC_BASE;
}

View file

@ -180,7 +180,7 @@ static inline BcVec* bc_program_vec(const BcProgram *p, size_t idx, BcType type)
static BcNum* bc_program_num(BcProgram *p, BcResult *r) {
BcNum *n = NULL;
BcNum *n;
switch (r->t) {