Consistent formatting and capitalization, clickable links to functions
defined in other parts of the manual, better looking css for html
output. Some small errors and typos have been corrected as well.
According to the documentation, we were supposed to return nil, but
instead we signaled a bogus error like
:INPUT argument to RUN-PROGRAM does not have a file handle:
#<output stream "/dev/null" 0x5645a22a5280>
Some of the compiler macros expand into FFI:C-INLINE forms, precluding
the compilation of statements like
(eval-when (:compile-toplevel :load-toplevel :execute)
(print "test")).
Commit b00e62f9d3 (now reverted)
attempted to fix this previously, but introduced other bugs (see #553).
Instead of the naive solution of evaluating everything
in (eval-when (:compile-toplevel)) directly with the bytecodes
compiler, the approach used in this commit is to be more specific and
ignore compiler macros during compile time evaluation (i.e. the output
of the compiler macro is used only in the emitted C code, but not as
input for CMP-EVAL).
Fixes#553.
After the recent refactor of GET-HOST-BY-NAME to use getaddrinfo,
these functions had multiple problems that are fixed in this commit:
- in GET-HOST-BY-NAME, freeaddrinfo was called on an unitialized
struct addrinfo if getaddrinfo failed
- error handling in GET-HOST-BY-NAME wasn't working, we were still
trying to use the error handling for gethostbyname
- GET-HOST-BY-ADDRESS still used the deprecated gethostbyaddr function
The test was failing because it was detecting an output of
"
Hello stdoutHello stderr"
instead of the expected
"
Hello stdout
Hello stderr"
The reason for this is that the buffers of the
streams *standard-output* and *error-output* may be distinct, even if
the ouput send to both streams ends up in the same place. Thus, we
need to explicitely force-output in print-test. The error manifested
itself only in builds without thread support, because otherwise ECL
uses write instead of fwrite, avoiding any buffering.
Make sure that apart from turning on/off signaling for exceptions, we
also clear all exception bits. After the recent changes to how ECL
handles floating point exceptions, not doing that could lead to
spurious exceptions being signaled even when using the
ECL_WITH_LISP_FPE macro because an earlier calculation yielded
infinity/NaN.
Not all processors will signal floating point exceptions even when
told so, for example the Raspberry Pi as Dave Richards pointed out on
the ecl-devel mailing list.
Using isnan and isfinite to check for floating point exceptions
doesn't work when we want floats to be able to have infinity or NaN as
values, thus this option was removed with commit
5f71f728a3. However, we can still use
fetestexcept to explicitly check if floating point exceptions occurred
even when we can't use the feenableexcept/SIGFPE signal delivery
mechanism.
Previously, we had something like this in the
ECL_MATHERR_TEST/ECL_MATHERR_CLEAR macros, but this was not used
consistently in our codebase (the ECL_MATHERR_TEST macro was missing
in many places). Instead of error-prone testing at every point of
computation, we call fetestexcept in DO_DETECT_FPE when creating a new
float/complex float. In order to avoid having to do this twice, the
DO_DETECT_FPE2 macro is introduced.
A minor disadvantage of this strategy is that floating point
exceptions may be signaled later than they occurred.
The gmp manual (https://gmplib.org/manual/Custom-Allocation.html) states
> GMP may use allocated blocks to hold pointers to other allocated
blocks. This will limit the assumptions a conservative garbage
collection scheme can make.
Thus we can't use ecl_alloc_atomic. We could just use ecl_alloc
instead, however our implementation is already structured in such a
way that it is sufficient to use ecl_alloc_uncollectable. The reason
for that is that currently all bignums except those in the bignum
registers in the thread local environment are allocated as compact
objects so that we only need to call mpz_clear for the few non-compact
objects in the bignum registers.
See also commits 7b536161 and bd48b859.
Fixes#485.
Remove flag AI_V4MAPPED which takes effect only for AF_INET6
family. Currently we do not work at all with ipv6, hence this flag is
a no-op. Moreover Android has no definition for this flag. See !172.
Fix contributed by Polos Ruetz. Closes!172.
Previously: unconditionally use the size from ECL_OPT_C_STACK_SIZE if
it is larger than the OS provided value and if possible resize the
stack at runtime.
Now: Use ECL_OPT_C_STACK_SIZE if provided. Otherwise, use a) the OS
provided value if we can resize the stack at runtime (for Unix) or b)
the new build option ECL_DEFAULT_C_STACK_SIZE (1 MB) if we can set the
stack size at link time (for Windows).
All functions declared with si::c-export-fname must be either in
symbols_list.h or have a proclamation so that the compiler knows the
number of arguments that the function takes.
si::coerce-to-vector assumed that the to be coerced object had the
same length as that specified by the type. This lead to segmentation
faults even in safe code, for example in
(coerce '(a b c) '(vector * 4))
(coerce.error.3 test in ansi-tests)
Actually, si::coerce-to-vector had some checks for a correct length
previously, but they did not work correctly and were removed in commit
baaab01841.