mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
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.
248 lines
6.5 KiB
Plaintext
248 lines
6.5 KiB
Plaintext
If you notice something wrong, strange or broken, try rereading:
|
|
|
|
README.FIRST
|
|
HOWTO.INSTALL
|
|
BUGS (this file)
|
|
|
|
If that does not help, cd to the calc source directory and try:
|
|
|
|
make check
|
|
|
|
Look at the end of the output, it should say something like:
|
|
|
|
9998: passed all tests /\../\
|
|
9999: Ending regression tests
|
|
|
|
If it does not, then something is really broken!
|
|
|
|
To be sure that your version of calc is up to date, check out:
|
|
|
|
http://www.isthe.com/chongo/tech/comp/calc/calc-mirror.html
|
|
|
|
If you made and modifications to calc beyond the simple Makefile
|
|
configuration, try backing them out and see if things get better.
|
|
|
|
If you have tried all of the above and things still are not right,
|
|
then it may be time to send in a bug report.
|
|
|
|
=-=
|
|
|
|
The BEST WAY TO SEND IN A BUG REPORT is via calc GitHub issue URL:
|
|
|
|
https://github.com/lcn2/calc/issues
|
|
|
|
If you see an existing issue that matches your problem, look
|
|
over the notes and if needed, add your own observation,
|
|
even if you just add to an existing issue:
|
|
|
|
I have this issue too
|
|
|
|
If you don't see your issue addressed, then on the above
|
|
GitHub web page, click on this button:
|
|
|
|
((New Issue))
|
|
|
|
=-=
|
|
|
|
If you prefer to not use GitHub, then you
|
|
may send bug and bug fixes reports to:
|
|
|
|
calc-bugrept-mail at asthe dot com
|
|
|
|
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
|
|
|
|
NOTE: This replaces the old calc-bugs at asthe dot com address.
|
|
|
|
PLEASE put following the SPECIAL PHRASE somewhere in your Email Subject line:
|
|
|
|
calc bug report
|
|
|
|
You may add additional words to your subject line.
|
|
|
|
Suggestion:
|
|
|
|
From time to time, the Email address and Subject SPECIAL PHRASE
|
|
may change so verify you have the current info by visiting:
|
|
|
|
http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html
|
|
|
|
IMPORTANT:
|
|
|
|
PLEASE use the above SPECIAL PHRASE somewhere in the Subject line or
|
|
the mail system won't deliver your Email message.
|
|
|
|
Keep in mind that the best way to report on a calc bug is
|
|
via the above mentioned calc GitHub issue URL.
|
|
|
|
Please be patient as we cannot always respond to Email messages quickly.
|
|
|
|
=-=
|
|
|
|
When you send your report, via the calc GitHub issue URL or Email,
|
|
please include the following information:
|
|
|
|
* A description of the problem
|
|
|
|
* Version of calc you are using
|
|
|
|
If you cannot compile calc, then look at version.c
|
|
and report the #define that start with:
|
|
|
|
#define MAJOR_VER
|
|
#define MINOR_VER
|
|
#define MAJOR_PATCH
|
|
#define MINOR_PATCH
|
|
|
|
* If you modified calc from an official patch,
|
|
send us the mods you made
|
|
|
|
* Type and version of the operating system
|
|
|
|
* Type and version of compiler
|
|
|
|
* Send us all compiler warnings or errors you find
|
|
|
|
* If calc dumped core, try to send us a core dump stack trace
|
|
|
|
* cd to the calc source directory, and send the contents
|
|
of debug.out produced by this command:
|
|
|
|
make debug > debug.out 2>&1
|
|
|
|
Fell free to use the above address to send in bug fixes (in the form
|
|
of a context diff patch).
|
|
|
|
=-=
|
|
|
|
Known bugs in calc:
|
|
|
|
Under macOS, the installation of the calc man page fails.
|
|
|
|
The output of the alg_config.cal resource file is bogus.
|
|
We would welcome a replacement for this code.
|
|
|
|
Calc shell scripts do not read from stdin properly,
|
|
we all as a number of the cscript examples.
|
|
|
|
The argv() function is behaving differently
|
|
when run in calc shell script mode:
|
|
|
|
When calc is run as:
|
|
|
|
calc -s a bb ccc
|
|
|
|
and given this input on the command prompt:
|
|
|
|
print "config(\"program\")=", config("program");
|
|
print "argv()=", argv();
|
|
argc = argv();
|
|
for (i=0; i < argc; ++i) {
|
|
print "argv(":i:")=", argv(i);
|
|
}
|
|
|
|
calc prints:
|
|
|
|
config("program")= calc
|
|
argv()= 3
|
|
argv(0)= a
|
|
argv(1)= bb
|
|
argv(2)= ccc
|
|
|
|
but when it is run as a script called ./simple:
|
|
|
|
#!/usr/local/bin/calc -q -s -f
|
|
print "config(\"program\")=", config("program");
|
|
print "argv()=", argv();
|
|
argc = argv();
|
|
for (i=0; i < argc; ++i) {
|
|
print "argv(":i:")=", argv(i);
|
|
}
|
|
|
|
under Linux prints:
|
|
|
|
config("program")= /usr/bin/calc
|
|
argv()= 4
|
|
argv(0)= ./simple
|
|
argv(1)= a
|
|
argv(2)= bb
|
|
argv(3)= ccc
|
|
|
|
and under macOS simply enters into interactive mode.
|
|
|
|
We are sure some more bugs exist. When you find them, please let
|
|
us know! See the above for details on how to report and were to
|
|
Email your bug reports and hopefully patches to fix them.
|
|
|
|
=-=
|
|
|
|
mis-features in calc:
|
|
|
|
Some problems are not bugs but rather mis-features / things that could
|
|
work better. The following is a list of mis-features that should be
|
|
addressed and improved someday.
|
|
|
|
* When statement is of the form { ... }, the leading { MUST BE ON
|
|
THE SAME LINE as the if, for, while or do keyword.
|
|
|
|
This works as expected:
|
|
|
|
if (expr) {
|
|
...
|
|
}
|
|
|
|
However this WILL NOT WORK AS EXPECTED:
|
|
|
|
if (expr)
|
|
{
|
|
...
|
|
}
|
|
|
|
This needs to be changed. See also "help statement", "help unexpected",
|
|
and "help todo".
|
|
|
|
* The chi.cal resource file does not work well with odd degrees
|
|
of freedom. Can someone improve this algorithm?
|
|
|
|
* The intfile.cal resource file reads and writes big or little Endian
|
|
integers to/from files the hard way. It does NOT use blkcpy. The
|
|
following code:
|
|
|
|
i = (ord("\n") << 16) | (ord("i") << 8) | ord("H")
|
|
b = blk()
|
|
copy(i, b)
|
|
fd = fopen("file", "w")
|
|
copy(b, fd);
|
|
fclose(fd)
|
|
|
|
will write an extra NUL octet to the file. Where as:
|
|
|
|
read intfile
|
|
i = (ord("\n") << 16) | (ord("i") << 8) | ord("H")
|
|
be2file(i, "file2")
|
|
|
|
will not.
|
|
|
|
=-=
|
|
|
|
## Copyright (C) 1999-2014,2021 Landon Curt Noll
|
|
##
|
|
## Calc is open software; you can redistribute it and/or modify it under
|
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
|
## as published by the Free Software Foundation.
|
|
##
|
|
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
|
## Public License for more details.
|
|
##
|
|
## A copy of version 2.1 of the GNU Lesser General Public License is
|
|
## distributed with calc under the filename COPYING-LGPL. You should have
|
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
##
|
|
## Under source code control: 1994/03/18 14:06:13
|
|
## File existed as early as: 1994
|
|
##
|
|
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
|
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|