| | @@ -638,7 +638,7 @@ |
| 638 | 638 | `div` rounds toward zero and `mod` takes the sign of the dividend, as |
| 639 | 639 | in C: `-7 div 2` is `-3`, `-7 mod 2` is `-1`. Dividing by zero, and |
| 640 | 640 | dividing the smallest value of a signed type by `-1`, stop the program |
| 641 | | -(`SIGFPE`), whatever the type and the target. |
| 641 | +(section 10), whatever the type and the target. |
| 642 | 642 | |
| 643 | 643 | `&` (and), `|` (or), `xor` and `~` (not) work on every bit. `x shl n` |
| 644 | 644 | and `x shr n` shift by `n` modulo the width of `x`'s type, in bits: |
| | @@ -1268,9 +1268,11 @@ |
| 1268 | 1268 | procedures registered with `Rt.atExit`, the last registered first, |
| 1269 | 1269 | each at most once; then it ends the program with `status`, through |
| 1270 | 1270 | C's `exit` in a program that uses C, so that C flushes its own |
| 1271 | | -buffers. A failed check (section 6.5) runs them too, after its |
| 1272 | | -message, so that `Out`'s buffer is written out. `Sys.exit` ends the |
| 1273 | | -program at once, and a program stopped by a signal runs none of them. |
| 1271 | +buffers. A program that stops (below), a failed check |
| 1272 | +(section 6.5) included, runs them too, after its message, so that |
| 1273 | +`Out`'s buffer is written out, and ends with status 2. `Sys.exit` ends |
| 1274 | +the program at once, and a program killed by a signal from outside runs |
| 1275 | +none of them. |
| 1274 | 1276 | |
| 1275 | 1277 | ``` |
| 1276 | 1278 | proc atExit*(p: proc): ERROR; (* Rt.Full if 32 are registered *) |
| | @@ -1296,7 +1298,8 @@ |
| 1296 | 1298 | breaks its rules, and C code can read or write any memory, and what |
| 1297 | 1299 | follows isn't defined. Dereferencing `nil`, dividing |
| 1298 | 1300 | by zero, calling a `nil` procedure and running out of stack stop the |
| 1299 | | -program, on every target. Before it stops, the program prints to |
| 1301 | +program, on every target, with status 2, as a failed check does. |
| 1302 | +Before it stops, the program prints to |
| 1300 | 1303 | standard error where it was, as file, line and column, and why, as far |
| 1301 | 1304 | as it can tell: a `nil` pointer, a `nil` procedure, a stack overflow, a |
| 1302 | 1305 | bad address or a division fault; then the calls under way, each with |