Added notes to help/unexpected about:
display() will limit the number of digits printed after decimal point
%d will format after the decimal point for non-integer numeric values
%x will format as fractions for non-integer numeric values
fprintf(fd, "%d\n", huge_value) may need fflush(fd) to finish
Fixed Makefile dependencies for the args.h rule.
Fixed Makefile cases where echo with -n is used. On some systems,
/bin/sh does not use -n, so we must call /bin/echo -n instead
via the ${ECHON} Makefile variable.
Add missing standard tools to sub-Makefiles to make them
easier to invoke directly.
Sort lists of standard tool Makefile variables and remove duplicates.
Declare the SHELL at the top of Makefiles.
Fixed the depend rule in the custom Makefile.
Improved the messages produced by the depend in the Makefiles.
Changed the UNUSED define in have_unused.h to be a macro with
a parameter. Changed all use of UNUSED in *.c to be UNUSED(x).
Removed need for HAVE_UNUSED in building the have_unused.h file.
CCBAN is given to ${CC} in order to control if banned.h is in effect.
The banned.h attempts to ban the use of certain dangerous functions
that, if improperly used, could compromise the computational integrity
if calculations.
In the case of calc, we are motivated in part by the desire for calc
to correctly calculate: even during extremely long calculations.
If UNBAN is NOT defined, then calling certain functions
will result in a call to a non-existent function (link error).
While we do NOT encourage defining UNBAN, there may be
a system / compiler environment where re-defining a
function may lead to a fatal compiler complication.
If that happens, consider compiling as:
make clobber all chk CCBAN=-DUNBAN
as see if this is a work-a-round.
If YOU discover a need for the -DUNBAN work-a-round, PLEASE tell us!
Please send us a bug report. See the file:
BUGS
or the URL:
http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html
for how to send us such a bug report.
Added the building of have_ban_pragma.h, which will determine
if "#pragma GCC poison func_name" is supported. If it is not,
or of HAVE_PRAGMA_GCC_POSION=-DHAVE_NO_PRAGMA_GCC_POSION, then
banned.h will have no effect.
Fixed building of the have_getpgid.h file.
Fixed building of the have_getprid.h file.
Fixed building of the have_getsid.h file.
Fixed building of the have_gettime.h file.
Fixed building of the have_strdup.h file.
Fixed building of the have_ustat.h file.
Fixed building of the have_rusage.h file.
Added HAVE_NO_STRLCPY to control if we want to test if
the system has a strlcpy() function. This in turn produces
the have_strlcpy.h file wherein the symbol HAVE_STRLCPY will
be defined, or not depending if the system comes with a
strlcpy() function.
If the system does not have a strlcpy() function, we
compile our own strlcpy() function. See strl.c for details.
Added HAVE_NO_STRLCAT to control if we want to test if
the system has a strlcat() function. This in turn produces
the have_strlcat.h file wherein the symbol HAVE_STRLCAT will
be defined, or not depending if the system comes with a
strlcat() function.
If the system does not have a strlcat() function, we
compile our own strlcat() function. See strl.c for details.
Fixed places were <string.h>, using #ifdef HAVE_STRING_H
for legacy systems that do not have that include file.
Added ${H} Makefile symbol to control the announcement
of forming and having formed hsrc related files. By default
H=@ (announce hsrc file formation) vs. H=@: to silence hsrc
related file formation.
Explicitly turn off quiet mode (set Makefile variable ${Q} to
be empty) when building rpms.
Improved and fixed the hsrc build process.
Forming rpms is performed in verbose mode to assist debugging
to the rpm build process.
Compile custom code, if needed, after main code is compiled.
Fixed Makefile dependenies for the args.h rule.
Fixed Makefile cases where echo with -n is used. On some systems,
/bin/sh does not use -n, so we must call /bin/echo -n instead
via the ${ECHON} Makefile variable.
Add missing standard tools to sub-Makefiles to make them
easier to invoke directly.
Sort lists of standard tool Makefile variables and remove duplicates.
Declare the SHELL at the top of Makefiles.
Fixed the depend rule in the custom Makefile.
The SWAP_ macros already write the result to their destination arg, so
there's no need for an extra assignment -- and this is undefined
behaviour because there are two assignments to the same variable without
an intervening sequence point (as GCC 10 correctly warns).
The following are the changes in this release:
Calc can now correctly compile without CUSTOM being defined,
thanks to a report by <GitHub user barsnick>.
Fixed how the *.tar.bz2 are formed. The calc-2.12.8.0.tar.bz2 file
that was formed for calc version 2.12.8.0 was missing most files.
Expanded 'make chk' to also verify that 'make distchk' and 'make
distlist' execute successfully. This will help check a regression
of the bug that produced the bogus calc-2.12.8.0.tar.bz2 file.
Added additional regression tests related 0^(zero_expression)==1.
Fixed how the *.tar.bz2 are formed. The calc-2.12.8.0.tar.bz2 file
that was formed for calc version 2.12.8.0 was missing most files.
Expanded 'make chk' to also verify that 'make distchk' and 'make
distlist' execute successfully. This will help check a regression
of the bug that produced the bogus calc-2.12.8.0.tar.bz2 file.
Added additional regression tests related 0^(zero_expression)==1.
Fixed a mistake in "help intro" where some inserted text changed
the value of "." and thus made the next result incorrect.
Clarified in "help factor" that 1 is returned if no
factor below the limit was found.
Removed Makefile variable ${MAKEFILE_REV}.
The missing cscript/square.calc file has been restored.
Fixed compiler errors and warnings related to GCC. In particular,
gcc/9.3.1 and gcc/10.2.1 now compile calc without any compiler
errors or warnings, even with -Werror -Wextra -pedantic.
To print out information about the calc compilation
environment, we added the following make rule:
make calcinfo
Improved how 'make debug' operates.
Moved help/contrib to CONTRIB-CODE. The help/contrib file
is now build from a copy of CONTRIB-CODE.
Created a new calc bug report Email address. Created a new
calc question Email address. Created a new calc contribution
Email address. See the BUGS file for details.
Added "help questions" to print the QUESTIONS help file.
If the environment variable $CALCHELP is defined and is non-empty,
then calc help files will be in the directory by the $CALCHISTFILE
environment variable.
If the environment variable $CALCCUSTOMHELP is defined and is
non-empty, then custom calc help files will be in the directory
by the $CALCCUSTOMHELP environment variable.
Fixed a number of typos in text and in source code comments.
The calc-tester mailing list has been retired. See:
* How to submit a calc bug report:
http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html
* How to contribute code to calc:
http://www.isthe.com/chongo/tech/comp/calc/calc-contrib.html
* How to submit a question about calc:
http://www.isthe.com/chongo/tech/comp/calc/calc-question.html
Fixed a mistake in "help intro" where some inserted text
changed the value of "." and thus made the next result
incorrect.
Clarified in "help factor" that 1 is returned if no
factor below the limit was found.
Removed Makefile variable ${MAKEFILE_REV}.
The missing cscript/square.calc file has been restored.
Fixed compiler errors and warnings related to GCC.
In particular, gcc/9.3.1 and gcc/10.2.1 now compile
calc without any compiler errors or warnings,
even with -Werror -Wextra -pedantic.
To print out information about the calc compliation
environment, we added the following make rule:
make calcinfo
Improved how 'make debug' operates.
Moved help/contrib to CONTRIB-CODE. The help/contrib file
is now build from a copy of CONTRIB-CODE.
Created a new calc bug report Email address. Created a new calc
question Email address. Created a new calc contribution Email
address. See the BUGS file for details.
Added "help questions" to print the QUESIONS help file.
If the environment variable $CALCHELP is defined and is non-empty,
then calc help files will be in the direcgory by the $CALCHISTFILE
environment variable.
If the environment variable $CALCCUSTOMHELP is defined and is
non-empty, then custom calc help files will be in the direcgory
by the $CALCCUSTOMHELP environment variable.
The calc-tester mailing list has been retired. See:
* How to submit a calc bug report:
http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html
* How to contribute code to calc:
http://www.isthe.com/chongo/tech/comp/calc/calc-contrib.html
* How to submit a question about calc:
http://www.isthe.com/chongo/tech/comp/calc/calc-question.html
Calc as defined 0^0 as 1. However in the past, 0 raised to
an expression that evaluted to zero returned 1. The result
was that 0^0 was different than 0^(6-6) or even 0^(0).
Now, calc will return 1 for 0^(0) and 0^zero when zero == 0.
By default, the calc history file is located in ~/.calc_history.
Now, if the environment variable $CALCHISTFILE is defined
and is non-empty, then calc history file will be defined
by the $CALCHISTFILE environment variable.
These changes are per calc version 2.12.7.3:
Requiring calc shell scripts to use -s -f at the end of the
initial #! line.
Fixed /tmp/mersenne example in calc(1) man page.
Added make variable ${ARCH_CFLAGS}. The ${ARCH_CFLAGS} is
added after ${CCMISC} and before ${EXTRA_CFLAGS} when building
the ${CFLAGS} for compiling C code. are ${CC} when compiling
C files. The default value is:
ARCH_CFLAGS= -march=native
which directs C compiler to compile for the native machine.
To disable use of '-march=native', set ARCH_CFLAGS to the empty
string as in:
make all ARCH_CFLAGS=
To make calc RPMs more portable, they are compiled with an
empty ARCH_CFLAGS.
These changes are per calc version 2.12.7.4:
Fixed issues relating to compiling on macOS. Fixed issues
where <unistd.h> is needed.
Requiring calc shell scripts to use -s -f at the end of the
initial #! line.
Fixed /tmp/mersenne example in calc(1) man page.
Added make variable ${ARCH_CFLAGS}. The ${ARCH_CFLAGS} is
added after ${CCMISC} and before ${EXTRA_CFLAGS} when building
the ${CFLAGS} for compiling C code. are ${CC} when compiling
C files. The default value is:
ARCH_CFLAGS= -march=native
which directs C compiler to compile for the native machine.
To disable use of '-march=native', set ARCH_CFLAGS to the empty
string as in:
make all ARCH_CFLAGS=
To make calc RPMs more portable, they are compiled with an
empty ARCH_CFLAGS.
Fixed issues relating to compiling on macOS. Fixed issues
where <unistd.h> is needed.
GCC 7 Added a warning for implicit fallthroughs in switch cases.
It's enabled by -Wextra, and treated as an error due to -Werror so
compilation fails on GCC 7 and higher.
See -Wimplicit-fallthrough in the GCC manual.
Corrected CHANGES notes that were mixed up for TAB, VT, CR &
NL. The code in 2.12.7.0 is correct. The CHANGE notes should
have read:
The following is a partial list of escape sequences recognized
in strings and in printf formats:
\a audible bell byte 0x07 in ASCII encoding
\b backspace byte 0x08 in ASCII encoding
\f form feed byte 0x0c in ASCII encoding
\n newline byte 0x0a in ASCII encoding
\r return byte 0x0d in ASCII encoding
\t tab byte 0x09 in ASCII encoding
\v vertical tab byte 0x0b in ASCII encoding
Sorry!
The following are the changes from calc version 2.12.7.0 to date:
Added a patch to replaces the manual search for include files
in $(INCDIR) in the have_*.h targets with compiler invocations.
Thanks goes to Helmut Grohne (helmut at subdivi dot de) who
implemented the patch and posted it to the Debian bug tracker
and Martin Buck (m at rtin-buck dor de) for forwarding it to us.
The check_include make rule was fixed to not assume /usr/include.
The qprintnum() function now takes outdigits as a 3rd argument.
Most of the time, this 3rd argument is just conf->outdigits.
But when it comes to the experimental '%g', this value can
change. This avoids having to modify conf->outdigits.
Fixed a problem where gcc complains about E_FUNC not being defined
for Linux systems as reported by Martin Buck (m at rtin-buck dor de).
Updated the help files help/config, help/display, help/epsilon,
help/fprint, help/printf, and help/strprintf to give more
examples of how display digits and epsilon precision interact
with displaying values.
Added more information about %g in the help file help/printf.
The '\a' is now recognized in a printf format string as the
single byte audible bell character (byte 0x07 in ASCII encoding).
The following is a partial list of escape sequences recognized
in strings and in printf formats:
\a audible bell byte 0x07 in ASCII encoding
\b backspace byte 0x08 in ASCII encoding
\f form feed byte 0x0c in ASCII encoding
\n newline byte 0x0b in ASCII encoding
\r return byte 0x0a in ASCII encoding
\t tab byte 0x0d in ASCII encoding
\v vertical tab byte 0x09 in ASCII encoding