The following are the changes in this release:
make clobber now removes the legacy files: have_fpos.h, help/man,
and help/usage. The latter 2 are now managed as help aliases
in help.c.
make install now removes the legacy files: ${HELPDIR}/man
and ${HELPDIR}/usage.
Fixed a problem where, when calc was linked with and uses GNU
readline then for any multi-line copy-and-paste, only the first
line is executed. Thanks to GitHub user @malfisya for reporting
this problem, and thanks to GitHub user @gromit1811 for doing
the research needed to overcome deficiencies in the GNU readline
documentation, and for supplying the work-a-round to allow
multi-line copy-and-paste to work as expected!
make clobber also removes the legacy files: help/man, and help/usage.
make install now removes the legacy files: ${HELPDIR}/man and
${HELPDIR}/usage.
Document the GNU readline then for any multi-line copy-and-paste
fix in CHANGES.
Fix for #138
According to
https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html
it's OK for readline() to return multi-line strings and/or newlines in case
of bracketed paste (enabled by default since readline 8.1) and also in other
situations even though its documentation explicitly states the opposite. So
we need to handle this properly in calc instead of just using the first line
and dropping the rest: Split the string returned by readline() into lines
and return line by line with each invocation of hist_getline(), each
possbily adding a terminating newline.
The following are the changes in this release:
Fixed bug that caused calc to fail to compile filepos2z() in file.c
on little endian machines for the Debian apcalc package. Thanks to
Martin Buck (m at rtin-buck dor de) for for fix.
Removed unused macros from zmath.h:
SWAP_B32_IN_HASH(dest, src)
SWAP_B16_IN_HASH(dest, src)
SWAP_B8_IN_HASH(dest, src)
SWAP_B32_IN_FLAG(dest, src)
SWAP_B16_IN_FLAG(dest, src)
SWAP_B8_IN_FLAG(dest, src)
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
is an assignment such as:
(*(dest) = *(src))
We now case the dest and src pointers to the proper type before
referencing and performing the assignment.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. Be sure to use ||'s between []'s
to avoid problems with legacy shell such as the Bourne shell. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.
The top level Makefile needs to use multiple []'s between ||'s
to not cause problems for legacy shells such as the Bourne shell.
For example:
```make
-${Q} if [ -z "${MANDIR}" ] || [ ! -s calc.1 ]; then \
...
-${Q} if [ -z "${CATDIR}" ] || [ ! -s calc.cat1 ]; then \
```
The following are the changes in this release:
Fixed bug that caused calc to fail to compile filepos2z() in file.c
on little endian machines for the Debian apcalc package. Thanks to
Martin Buck (m at rtin-buck dor de) for for fix.
Removed unused macros from zmath.h:
SWAP_B32_IN_HASH(dest, src)
SWAP_B16_IN_HASH(dest, src)
SWAP_B8_IN_HASH(dest, src)
SWAP_B32_IN_FLAG(dest, src)
SWAP_B16_IN_FLAG(dest, src)
SWAP_B8_IN_FLAG(dest, src)
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
is an assignment such as:
(*(dest) = *(src))
We now case the dest and src pointers to the proper type before
referencing and performing the assignment.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.
Documented unexpected behavior when calc is running in
"shell script mode" and the prompt builtin function is used
without the -p flag. Updated help/prompt, help/unexpected
and the calc man page accordingly.
Unless calc is given the -p command line option, calc will reopen
stdin as /dev/null instead of just closing stdin. This prevents
subsequent opens grabbing the 1st file descriptor.
Disable regress tests 4709, 4710, and 7763 because they print
multi-byte sequences, which are just fine for calc, the awk
used to evaluate the regression suite output in some legacy
systems report a "multibyte conversion failure".
Added a number of missing Makefile variables to the "make env" rule.
The man command is used to format the calc.1 man page into calc.usage.
The "help calc" command now prints the formatted calc man page (calc.usage).
The "help man" command now prints the formatted calc man page (calc.usage).
The "help usage" command now prints the formatted calc man page (calc.usage).
The file, calc.cat1, is formed by gzipping the calc.usage
formatted man page. The calc.cat1 is installed as the calc
cat section 1 man page.
Updated the Copyright string in version.c to refer to
the COPYING file and the "help copying" command.
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
whose shell do not support them. *sigh*
Fixed the order of "help full" to match the order of topics listed
buy the "help help" command.
Sorted the halias[] help topics table in help.c using sort -d -u.
Fixed bug that caused calc to fail to compile filepos2z() in file.c
on little endian machines for the Debian apcalc package. Thanks to
Martin Buck (m at rtin-buck dor de) for for fix.
Removed unused macros from zmath.h:
SWAP_B32_IN_HASH(dest, src)
SWAP_B16_IN_HASH(dest, src)
SWAP_B8_IN_HASH(dest, src)
SWAP_B32_IN_FLAG(dest, src)
SWAP_B16_IN_FLAG(dest, src)
SWAP_B8_IN_FLAG(dest, src)
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
is an assignment such as:
(*(dest) = *(src))
We now case the dest and src pointers to the proper type before
referencing and performing the assignment.
The following are the changes in this release:
Updated BUGS about MSYS2 on Windows compiling of calc.
Added more git related checks and sanity checks to chk_tree.
Added ${FSANITIZE} make variable to Makefile.config to hold
common Address Sanitizer (ASAN) optins to modern Linux and macOS.
The Address Sanitizer is NOT enabled not compiled in by default.
Improved comments in Makefile.local for RHEL9.2 (Linux) and for
macOS 14.0 that, when uncommented and calc is recompiled (i.e.,
make clobber all) will enable the Address Sanitizer (ASAN) for calc.
Fixed memory leaks in the logn, aversin, acoversin, avercos,
acovercos, ahaversin, ahavercos, ahacovercos, aexsec,
aexcsc, and acrd.
Fixed a compile error in zmath.h that impacted legacy 32-bit Big
Endian machines. Thanks goes to GitHub user @gromit1811 for their
pull request.
Fixed the check for <sys/mount.h> when forming have_sys_mount.h.
Thanks goes to GitHub user @gromit1811 for their pull request.
Added "STATIC bool blum_initialized = false" to zrandom.c to improve
how the code detects if the Blum-Blum-Shub pseudo-random number
generator is seeded or not, and how to free the state correctly.
NOTE: There is a very minor memory leak in zrandom.c that will be
fixed in a later release.
Added "STATIC bool blum_initialized = false" to zrandom.c to improve
how the code detects if the Blum-Blum-Shub pseudo-random number
generator is seeded or not, and how to free the state correctly.
NOTE: There is a very minor memory leak in zrandom.c that will be
fixed in a later release.
So far, the Makefile checked for sys/param.h instead and that suspiciously
looks like a copy & paste error.
Found by the Debian hurd-i386 build daemon because calc failed to compile
there and it seems to lack sys/mount.h. Not that this would be an extremely
relevant architecture these days, but nevertheless... ;-)
On ancient 32 bit big endian machines (e.g. MIPS) file.c fails to build
when FILEPOS is a struct and not a scalar. This happens because the
SWAP_HALF_IN_FILEPOS macro essentially expands to a simple assignment in
this case but the types are incompatile (HALF and FILEPOS).
Detailed compile error (this is from an older version so line numbers might
be wrong but the error is the same):
gcc -DCALC_SRC -DCUSTOM -Wall -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -O3 -g3 -Wno-error=long-long -Wno-long-long -c file.c
In file included from qmath.h:32,
from cmath.h:32,
from value.h:33,
from calc.h:33,
from file.c:39:
file.c: In function 'filepos2z':
zmath.h:85:46: error: incompatible types when assigning to type 'HALF' {aka 'long unsigned int'} from type 'FILEPOS' {aka 'struct _G_fpos_t'}
#define SWAP_HALF_IN_B32(dest, src) (*(dest) = *(src))
^
fposval.h:15:42: note: in expansion of macro 'SWAP_HALF_IN_B32'
#define SWAP_HALF_IN_FILEPOS(dest, src) SWAP_HALF_IN_B32(dest, src)
^~~~~~~~~~~~~~~~
file.c:1370:2: note: in expansion of macro 'SWAP_HALF_IN_FILEPOS'
SWAP_HALF_IN_FILEPOS(ret.v, &pos);
^~~~~~~~~~~~~~~~~~~~
Fix this by adding suitable casts to the definition of SWAP_HALF_IN_FILEPOS
on big endian machines. Strictly speaking, the casts only seem to be
necessary when using SWAP_HALF_IN_B32, but they can't hurt in the other
cases either.
The chk_tree will check for files in distlist that
would otherwise be ignored by trailblank or that
are used, by convention, as tempory / test files.
Fixed a shellcheck nit in trailblank.
Updated BUGS about MSYS2 on Windows compiling of calc.
Added more git related checks and sanity checks to chk_tree.
Added ${FSANITIZE} make variable to Makefile.config to hold
common Address Sanitizer (ASAN) optins to modern Linux and macOS.
The Address Sanitizer is NOT enabled not compiled in by default.
Improved comments in Makefile.local for RHEL9.2 (Linux) and for
macOS 14.0 that, when uncommented and calc is recompiled (i.e.,
make clobber all) will enable the Address Sanitizer (ASAN) for calc.
Before, make prep would show but not object to chk_tree failures.
Now, if all except chk_tree is OK, make prep will report:
almost satifactory except for chk_tree