diff options
author | Stefan Eßer <se@FreeBSD.org> | 2020-10-01 15:40:24 +0000 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2020-10-01 15:40:24 +0000 |
commit | 9fef4b8de311c90cf35556217ec9e472c164f1a2 (patch) | |
tree | be26a5882ff196a219183e684e983bfbd23f9055 | |
parent | 592e97f5f6ed46b0e508b0be5511780ad9b336f6 (diff) |
Notes
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | NEWS.md | 8 | ||||
-rw-r--r-- | include/bc.h | 4 | ||||
-rwxr-xr-x | release.sh | 1 | ||||
-rw-r--r-- | src/data.c | 4 | ||||
-rw-r--r-- | src/num.c | 5 |
6 files changed, 19 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in index 3edc9ef16ec1..53f782c02791 100644 --- a/Makefile.in +++ b/Makefile.in @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.5 +VERSION = 3.1.6 SRC = %%SRC%% OBJ = %%OBJ%% @@ -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` diff --git a/include/bc.h b/include/bc.h index 4423525bad3e..383e7e7ec562 100644 --- a/include/bc.h +++ b/include/bc.h @@ -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 diff --git a/release.sh b/release.sh index 06663b998f72..d6cc74b43118 100755 --- a/release.sh +++ b/release.sh @@ -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" diff --git a/src/data.c b/src/data.c index 2556f795eed6..039c83e1cac1 100644 --- a/src/data.c +++ b/src/data.c @@ -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", diff --git a/src/num.c b/src/num.c index 05b4654f21f5..de5fa5c566fb 100644 --- a/src/num.c +++ b/src/num.c @@ -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; } |