Skip to content

Releases: lcn2/calc

calc 2.16.1.2 release

08 Jan 03:46

Choose a tag to compare

The following are the changes in this release:

Fixed a bug where the calc command history was not being properly
saved in the history file.  Thanks go to the GitHub user @Vekhir
for both reporting this problem and helping come up with a solution.

Per request, we expanded number of entries to save from 1024 to 4096.

Release v2.16.1.1

04 Jan 08:34

Choose a tag to compare

The following are the changes in this release:

Fix compiler warning for `custom/u_pfe.c`.

Update the `ARCH_CFLAGS` make symbol comments in `Makefile.config`.

Add `ARCH_CFLAGS` to `COMMON_CFLAGS` in `Makefile.config`.

Add "RHEL (Linux) Address Sanitizer (ASAN) for i686" commented out
section to `Makefile.local`.

Improve comments in `Makefile.local` related to "Address Sanitizer (ASAN)".

Add `junk4200` to `.gitignore`.

Use `-${Q}` instead of `-@` while build hsrc files in `Makefile`.

Fix `pseudo_seed()` in `seed.c` to handle 32-bit architectures.

Fixed `reopenid()` in `file.c` to handle 32-bit architectures and
to avoid "glibc detected an invalid stdio handle" using `freopen(3)`.

Fixed bug in `c_power()` in `comfunc.c` that caused 32-bit
architectures to dump core.

Fixed bug in `zrandom()` in `zrandom.c` where results from a
Blum-Blum-Shub operation were incorrectly copied into a ZVALUE
for 32-bit architectures.

Fixed comment typo in `cal/regress.cal` before test 5305.

calc 2.16.1.0 release

31 Dec 05:16

Choose a tag to compare

The following are the changes in this release:

Added a new `.clang-format` file as the basis for using the
`clang-format(1)` tool to format calc source in a consistent way.
This code re-formatting will make it easier to work in calc v3 code
changes in the future by making the calc source much more consistent.

Removed `.clang-format` exclusion from `.gitignore`.

Modified `func.c` to prevent the `clang-format(1)` tool from formatting
the `builtins[]` table that builtin make rule in `help/Makefile` uses to
format the `help/builtin` file.  We can live with the `builtins[]`
table as it is today, for now.

Add `make clang-format` make rule to top level `Makefile` and
to the `custom/Makefile`.

Reformatted C code as per the `clang-format(1)` and the
`.clang-format` file: using the `make clang-format` make rule.

calc 2.16.0.3 release

25 Dec 10:09

Choose a tag to compare

The following are the changes in this release:

The segmentation fault as reported in issue #174 has been fixed.
When the `powervalue()` function was expanded to (in `value.c`), to
process complex powers, the author forgot that the function `c_power()`
returns NULL when the result is too large to represent in memory.  Now,
when `c_power()` returns NULL within the `powervalue()` function, the
`E_POWER_4` math error ("Too-large value for power") will be raised.
Thanks go to the GitHub user @mengrj for reporting this problem
in issue #174 in a clear and concise way such that we were able
to fix this problem.

Reduced `MAXCMD` (maximum length of command invocation) in `calv.h`
from 16384 to 5120.  On most systems, commands longer than 5.6k would
hit the soft stack size limit and trigger a stack overflow condition
causing calc to crash with a SIGSEGV (segmentation violation).

If you need a super-long calc commands, consider increasing
the `MAXCMD` value in `calc.h`, and increase the stack size
limits for your calc run.  For example under Linux to increase
the maximum stack size to 2^28 bytes:

    prlimit --stack=268435456 calc

or:

    ulimit -s 49152
    calc

Resolved, as much we can, issue #175.

Recommend `-fstack-protector-all` in `Makefile.local` comments.

Fixed signed integer overflow in `c_power()`.

The `c_power(COMPLEX *c1, COMPLEX *c2, NUMBER *epsilon)` function in
`comfunc.c` no longer triggers a signed integer overflow.

Added `qqbitvalue(NUMBER pos)` to `qmarth.c`: like `qbitvalue(long n)`
but with a NUMBER arg, and will return NULL if the shifted bit is too
large to hold in memory.

Added `zzbitvalue(ZVALUE pos, ZVALUE *res)`: similar to the
`zbitvalue(long n, ZVALUE *res)` function but with a `ZVALUE` arg,
and returns a boolean, and does not call math_error().

Added `ZVALUE _baseb_` to hold the `BASEB` as a `ZVALUE`.
Added `MAXDATA_LOG2` to hold the log base 2 value of `MAXDATA`.
Added `MAXLEN_LOG2` to hold the log base 2 value of `MAXLEN`.
Added `HALF_BITS` as an alias for `BASEB`.

Added to `cal/regress.cal`, regression test 9758 to test for
the condition that issue #174 was about.

Improved the Common Address Sanitizer (ASAN) comments in
`Makefile.config` and `Makefile.local`.

Resolved issue #176.

calc 2.16.0.2 release

22 Dec 03:39

Choose a tag to compare

The following are the changes from calc version 2.16.0.1 to 2.16.0.2:

Fixed bug, when custom functions were enabled, where returning a
value from the sysinfo custom function such as:

    custom("sysinfo","DEFAULTSHELL")

would cause a segmentation violation due to an improper `free(3)`.

Fixed a memory leak that was related to the sysinfo custom function.

Added paranoia checks on shell value when processing commands
read from the tty that start with the "!" character.

Improved code that converts between UPPER CASE and lower case.

Verify that the default underlying shell defaults to the shell
as given by the `$SHELL` environment variable if that environment
variable is set and is NOT empty, otherwise the `DEFAULTSHELL`
(as defined in `calc.h`) value will be used as the underlying shell.

Fixed memory leaks related to various environment variable values
used by calc code.  All various environment variable values used
used by calc code are processed by `strdup(3)`.

The `libcalc_call_me_last()` function frees any non-NULL values set
by `initenv()`.

If the readline tilde_expand fails to expand "~/.calc_history",
then ".calc_history" will be used as the name of the history file.

Added HIST_NULL_HIST code to indicate that name of the history file
could not be set.

The following are the changes from calc version 2.16.0.0 to 2.16.0.1:

Adding support for "pipe/fork/exec and friends" via custom functions
thanks to a contribution by GitHub user @vike2000.

We to address a bug after adding support for pipe/fork/exec (and
friends) via custom functions

TODO: Before the calc v2 to calc v3 fork, we need to fix a critical
[bug](https://github.com/lcn2/calc/issues/103#issuecomment-3194363618)
related to heap-use-after-free memory errors.  We anticipate this
will involve releasing a bug fix version of calc and then allow
for extensive testing before declaring the resulting 2.16.0.x as a
stable release.  From that 2.16.0.x stable release that a new version
2.16.1.0 stable release, with no changes other than a new version
number and git tag as the basis for the calc v2 to calc v3 fork.

calc 2.16.0.0 release

15 Aug 01:58

Choose a tag to compare

calc 2.16.0.0 release Pre-release
Pre-release

The following are the changes in this release:

Starting with calc version 2.16.0.0, the ability to perform arithmetic
on addresses of values in calc objects has been greatly restricted.

Most arithmetic on of value addresses could easily cause calc to
crash.  For example, prior to calc version 2.16.0.0, the following
command was likely to crash calc:

    calc '*((&.)+1e9)'

Subtracting two value addresses is permitted, however there is NO
guarantee that the address of a value will remain consistent across
calc runs.  Addresses of values depend on the circumstances of when
the calc values were formed.

The above restrictions and caveats apply to addresses of values.
Such restrictions and caveats to NOT apply to the addresses of
octets, NOR to the addresses within strings.  If isptr(x) == 2, then
x is value-pointer and the above mentioned restrictions and caveats apply.

See "help address" for more information on value address arithmetic.

Added E_INVALID_DEREF (10610) error code to indicate the invalid
dereferencing a non-variable.

Added E_INVALID_ADDR_OP (10611) error code to indicate an invalid
arithmetic address operation.

We plan to let this most recent change settle down before performing
the calc v2 to calc v3 fork.  Therefore, version 2.16.1.0 will form
the basis for the calc v2 to calc v3 fork.

calc 2.15.1.2 release

13 Aug 20:41

Choose a tag to compare

calc 2.15.1.2 release Pre-release
Pre-release

The following are the changes in this release:

Removed use of HAVE_MEMMOVE as well have_memmv.c.  Removed the
building and including of have_memmv.h.  Removed the memmove()
function in blkcpy.c, used when HAVE_MEMMOVE was NOT defined.
The libc memmove(3) function as defined by <string.h> is now
required to compile calc because the replacement code in
blkcpy.c q was problematic, especially when regions overlap.
The HAVE_MEMMOVE make symbol was removed from Makefile.config.
Thanks to GitHub user @skeeto for reporting this problem.

calc 2.15.1.1 release

24 Apr 02:58

Choose a tag to compare

The following are the changes in this release:

Change Makefile.config to, if not using not HomeBrew, then try to
detect macports and/or using /opt/local/{lib,include}.

Put full date range (1989-2025) of calc source into version.h.

calc 2.15.1.0 release

12 Jul 06:29

Choose a tag to compare

The following are the changes in this release:

Converted all ASCII tabs to ASCII spaces using a 8 character
tab stop, for all files, except for all Makefiles (plus rpm.mk).
The command `git diff -w` reports no changes.  There is no
functionality change in calc: only ASCII tabs to ASCII spaces.

Fixed trailblank.  It was pruning . in its find search.
Added check for ASCII tabs is non-Makefiles.

This version will form the basis for the calc v2 to calc v3 fork.

calc 2.15.0.7 release

28 May 02:12

Choose a tag to compare

The following are the changes in this release:

Thanks to GitHub user @bambooleafz a critical bug (GitHub issue
#148 - https://github.com/lcn2/calc/issues/148) they identified
was fixed.