Before this PR, `tests/misc/tconv.nim` fails when the compiler
is compiled without `-d:danger` flag.
Bear in mind that even without the asserts, the values outside of
a given range are still checked and a meaningful error message
(from `compiler/semexprs.nim`) is printed.
(cherry picked from commit 107b40f097)
* fix undefined behavior in terminate handler
* fix failing unit test
* Revert "fix failing unit test"
This reverts commit 0e5e385fbf.
* Revert "fix undefined behavior in terminate handler"
This reverts commit 2b582871f1.
* do not throw inside terminate handler with msvc < 1923
(cherry picked from commit 4e841ab156)
The reason for this revert is that 'runnableExamples' keep
mysteriously failing on 32-bit OS-es on version 1.0.x
(devel version is fine, as are 64-bit OS-es).
One improvement over #devel is visible in the transformation of getEnv. With this approach we move to result whenever possible.
(cherry picked from commit 5f5879dc4c)
'countBits32' is now fixed in the same way that
'countBits64' was already patched earlier (by adding 'u32
where needed).
(cherry picked from commit ae32d637f7)
cast[T](0) is interpreted as a link to id 0 with text T, so escape
the opening parentheses to display the intended output.
(cherry picked from commit 59c1f7c87f)
This is more friendly to those browsing the documentation without
a network connection. The nim-doc package in Debian allows this,
for example.
Also, the domain name being used was not consistent. It could have
been either nim-lang.org or nim-lang.github.io, and those reading
the stable docs could have found themselves suddenly reading the
devel docs instead.
(cherry picked from commit 72147c9ba4)
Note that contrary to what docgen.rst currently says, the ids have
to match exactly or else most web browsers will not jump to the
intended symbol.
(cherry picked from commit 93461aee34)
* Clarifies experimental / parallel on manual.rst
Details:
Calling `useParallel()` in example fails with compiler error
Error: 'parallel' section without 'spawn'
Adding `spawn` causes error:
Error: internal error: (filename: "ccgexprs.nim", line: 1032, column: 17)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
Therefore a separate proc, `threadedEcho`, is added for the echo'ing
of the string, which allows the example to build, however, `sync()`
must be added so that the "echo in parallel" strings will actually
be shown on the terminal. Otherwise, the program will spawn of the
threads and exit before they can return to the main thread.
* Fixes and clarifies example for threading in manual.rst
Issue:
Calling useParallel() in example failed with compiler error
`Error: 'parallel' section without 'spawn'`
Adding spawn yielded compiler error:
```bash
Error: internal error: (filename: "ccgexprs.nim", line: 1032, column: 17)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c
```
Proposed Solution:
- Separate proc, threadedEcho, is added for the echo'ing
of the string, which allows the example to build
- Added the thread number so that it can demonstrate that sometimes
threads which were started sooner, come back after threads which
were started later.
(cherry picked from commit d731646106)