Commit graph

7754 commits

Author SHA1 Message Date
Marius Gerbershagen
25d8bf63ef cmp: fix linker-cc for msvc
linker-cc for other compilers includes the libpath in the linker
options, therefore for consistency we need it here too.
2019-08-20 19:52:25 +02:00
Marius Gerbershagen
2003b7f999 streams: don't return 0 in file-column if column can't be determined
Instead we return an invalid value (-1 for ecl_file_column and nil for
si_file_column). All users of these functions already deal correctly with
invalid values.

Fixes #309.
2019-08-20 15:36:56 +02:00
Marius Gerbershagen
1d0abc9c43 numlib: remove unneeded workaround for msvc 2019-08-20 14:41:53 +02:00
Marius Gerbershagen
2b3f7bb1fd numlib: fix return value of signum for complex zero 2019-08-19 20:26:10 +02:00
Marius Gerbershagen
c1c68bb4fe bytecmp: fix return value of multiple-value-bind with no variable bindings and no body
Statements such as (multiple-value-bind () :foo) returned :foo instead
of nil (see the multiple-value-bind.11-13 tests in the ansi-test
suite).
2019-08-19 19:46:27 +02:00
Marius Gerbershagen
c38739f3bb format: fix addition of fill style newlines in ~< ... ~:@> directive
Only add fill style newline for blanks that don't follow a ~ newline
directive (see the format.logical-block.23 test in the ansi-test
suite).
2019-08-19 18:07:13 +02:00
Daniel Kochmański
df339485eb Merge branch 'infinity-NaN-numeric-functions' into 'develop'
Make all numeric functions return sensible values for infinity/NaN

Closes #477

See merge request embeddable-common-lisp/ecl!160
2019-08-16 18:52:23 +00:00
Daniel Kochmański
8b82c98cac Merge branch 'alt-fix-513' into 'develop'
Fix 513 2nd try

Closes #514

See merge request embeddable-common-lisp/ecl!159
2019-08-16 18:44:23 +00:00
Marius Gerbershagen
e385abb213 ieee-fp: document the behaviour of numeric functions for infinity/NaN 2019-08-14 21:46:39 +02:00
Marius Gerbershagen
3c2105fe3d ieee-fp: add tests for numeric functions with infinity/NaN 2019-08-14 20:51:40 +02:00
Marius Gerbershagen
57db4c813c complex-float: use CMPLX for constructing complex floats
Works better for edge cases such as x + I*∞, which otherwise would
lead to a complex with NaN real part.
2019-08-14 20:51:40 +02:00
Marius Gerbershagen
327da031cd ieee-fp: fix asin/acos/asinh/acosh/atanh for NaN 2019-08-14 20:51:40 +02:00
Marius Gerbershagen
ac19a3f0a9 ieee-fp: fix round function for NaN 2019-08-14 20:51:40 +02:00
Marius Gerbershagen
fa28f08770 ieee-fp: fix ext:float-{infinity/nan}-p
ext:float-infinity-p returned true for NaNs and ext:float-nan-p was
slower than necessary.
2019-08-14 20:51:40 +02:00
Marius Gerbershagen
5c7aecc15f ieee-fp: fix min/max for NaN
As for the C functions fmin/fmax, we ignore NaNs
2019-08-14 20:51:40 +02:00
Marius Gerbershagen
a597fd5379 eql: fix NaN comparison
Old approach doesn't work reliably on x86_64. See e.g.

> (eql (+ ext:double-float-negative-infinity ext:double-float-positive-infinity) (ext:nan))
NIL
2019-08-14 20:51:40 +02:00
Marius Gerbershagen
046c6b9f32 number_compare.d: fix number comparison for NaN
All comparisons with NaN should return NIL for consistency with the
IEEE standard.
2019-08-14 20:51:40 +02:00
Marius Gerbershagen
d9a105dabc numlib.lsp: make signum return proper values for infinity/NaN 2019-08-14 20:51:40 +02:00
Marius Gerbershagen
2cbe875668 dffi: fix bug in converting to :cstring's
We used the next argument instead of the current one. Bug identified
and fixed by Christoph Buck.
Fixes #523.
2019-08-06 20:14:10 +02:00
Marius Gerbershagen
61e799074d cmp: fix type propagation for / with one argument
Fixes #522.
2019-08-06 19:38:47 +02:00
Marius Gerbershagen
5859593b82 Merge branch 'develop' into 'develop'
buildsystem: remove unnecessary nodefaultlib linker flags(msvc)

See merge request embeddable-common-lisp/ecl!157
2019-08-06 16:48:31 +00:00
zyg
3108680e43 buildsystem: update windows msvc build instructions 2019-08-06 21:59:05 +08:00
Exaybachay
f61cb729f9 doc: update msvc build descriptions 2019-07-30 10:36:54 +08:00
Exaybachay
30f1ffcd5d buildsystem: remove unnecessary nodefaultlib linker flags(msvc)
MS link.exe can pick the right crt libraries according to the compiler flags,
such as /MD, /MDd etc.

So we remove them to keep the command line tidy and clean.
2019-07-26 11:55:52 +08:00
Marius Gerbershagen
f331600f84 subtypep and type=: fix bogus type error
It can happen for example in
  (subtypep t '(CONS (AND STANDARD-CHAR (MEMBER #\@)) REAL))
that in subtypep and type= the second call to safe-canonical-type
fails and returns the error from +canonical-type-failure+ instead of a
valid tag. This leads to type-errors in logandc2 or = which expect an
integer.
Fixes #519.
2019-07-24 19:03:07 +02:00
Marius Gerbershagen
0ff3e27b54 ECL_STACK_FRAME_VARARGS: Use the correct struct 2019-07-23 18:45:49 +02:00
Marius Gerbershagen
912f4e49dc apply_from_stack_frame: use correct frame base
Previously, we assumed that all stack frames were lying at the top of
the lisp stack. This is not always true due to e.g.
multiple-value-prog1 pushing onto the lisp stack.
2019-07-23 18:45:24 +02:00
Marius Gerbershagen
13358703d0 Merge branch 'develop' into 'develop'
buildsystem: with-manual in configure script should be enable-manual

See merge request embeddable-common-lisp/ecl!156
2019-07-22 18:57:08 +00:00
Exaybachay
9e7d545b3e buildsystem: with-manual in configure script should be enable-manual 2019-07-22 22:36:02 +08:00
Daniel Kochmański
adace6ba08 cmp: replace magic number with a defined constant
The magic number was wrong anyway.
2019-07-20 09:22:01 +02:00
Daniel Kochmański
f3c6e4ccef cmp: remove unused interface *linking-calls*
Variable is always nil so blocks of code are never executed. Remove
it. TRAMPOLINK was used only in such bodies.
2019-07-19 14:30:53 +02:00
Daniel Kochmański
923a34130b apply: remove case for 64 arguments
C argument limit is set to 63, this case is not harmful but *may*
confuse a person who reads the code. If we raise the limit adding
remaining cases is trivial.
2019-07-19 14:30:53 +02:00
Daniel Kochmański
0e7ef61b69 cmp: t3local-fun-declaration: do not call next-lcl more than needed
When we process required arguments their amount may exceed maximum
number of arguments which are allowed to be passed on C stack. In this
case the remainder is shifted to optionals *but* we have called
next-lcl for all arguments what lead to a situation where all
arguments were passed on the list. Fixes #514.
2019-07-19 14:30:53 +02:00
Daniel Kochmański
23e02dbd9d cosmetic: align slot 2019-07-19 14:30:53 +02:00
Daniel Kochmański
903156b8d6 preprocessor: error when ECL_C_ARGUMENTS_LIMIT changes
This is a canary which errors when code needs to be adjusted. When
appropriate definitions are added the error condition should be
changed accordingly.
2019-07-19 14:30:50 +02:00
Daniel Kochmański
5986aee429 ECL_STACK_FRAME_VARARGS_BEGIN: fix off-by-one error
We allocate arguments on a heap when number of them exceeds
ECL_C_ARGUMENTS_LIMIT. Was:

  if (narg <  ECL_C_ARGUMENTS_LIMIT) ... else ..

should be

  if (narg <= ECL_C_ARGUMENTS_LIMIT) ... else ..

It is a partial fix for #513 (solves a segfault).
2019-07-19 14:21:06 +02:00
Daniel Kochmański
faca0641f9 tests: add regression test for #513 2019-07-19 14:21:03 +02:00
Daniel Kochmański
db41388791 cleanup: remove unused code
- ECL_ASM_APPLY was never used (apply assembly implementation for x86)
- ECL_USE_VARARG_AS_POINTER was never used
2019-07-16 09:04:46 +02:00
Daniel Kochmański
7a2658fbe3 Merge branch 'file-stream-improvements' into 'develop'
File stream improvements

See merge request embeddable-common-lisp/ecl!153
2019-07-15 22:13:04 +00:00
Marius Gerbershagen
1334eb1765 cmp: prevent deadlock if the C compiler output is too large
The pipe from which we read the output of the C compiler could fill up
when a large number of warnings were printed leading to a deadlock
because we waited for the C compiler to finish before reading the
output.
2019-07-15 21:32:36 +02:00
Daniel Kochmański
f6d2aac142 Merge branch 'fpe' into 'develop'
Floating point environment changes

See merge request embeddable-common-lisp/ecl!154
2019-07-15 09:56:01 +00:00
Marius Gerbershagen
d1718a1f7e ieee-fp: remove old floating point environment workarounds
It is better to let the user disable these features with configure
options than having a bunch of unmaintained workarounds lying around.
2019-06-30 13:04:18 +02:00
Marius Gerbershagen
9a2ea39987 Revert "prevent floating point exception signals if ECL_OPT_TRAP_SIGFPE is false"
This reverts commit 2a9084b105.

It turned out that #347 was caused by the Maxima computer algebra
system enabling floating point exceptions via si:trap-fpe (see
https://trac.sagemath.org/ticket/22191). Hence we can revert to the
less intrusive behaviour of not changing the floating point
environment if ECL_OPT_TRAP_SIGFPE is false.
2019-06-30 13:01:24 +02:00
Marius Gerbershagen
34f26e8b71 si:trap-fpe: move into ext package and extend documentation 2019-06-30 13:01:24 +02:00
Marius Gerbershagen
b891630699 ieee-fp: introduce new macro for toggling between Lisp and C fpe
This is primarly useful for embedding. Lisp code can be safely
executed without leaking the floating point environment into other C
code.
2019-06-30 13:01:06 +02:00
Marius Gerbershagen
06f0a93421 doc: fix small typos and errors 2019-06-21 20:18:56 +02:00
Marius Gerbershagen
ba9ad6c444 reader: be more liberal in the syntax that we accept with *read-suppress*
Also allow commas without backquotes and invalid characters.
Return nil for backquotes (bug fixed).
Document the current behaviour.
Fixes #494.
2019-06-21 20:18:12 +02:00
Marius Gerbershagen
6163466a7b tests: extend external-format tests
We now also test random combinations of read and write functions.
2019-06-15 20:33:17 +02:00
Marius Gerbershagen
2909c1ec39 file.d: return NIL if ftello fails with ESPIPE
We already do the same in io_file_get_position if lseek fails with
ESPIPE.
2019-06-15 18:34:11 +02:00
Marius Gerbershagen
e1d857f38f file.d: fix line breaks for write-sequence 2019-06-15 18:33:50 +02:00