Overflows in Phobos
Shachar Shemesh via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 27 00:28:57 PDT 2016
On 27/07/16 10:14, Walter Bright wrote:
> Thank you. I'd prefer it to say something along the lines that it stops
> execution at the assert(0) in an implementation-defined manner. This
> leaves whether messages are printed or not, etc., up to the
> implementation. I don't think the spec should require more than that
> (for example, some uses may have no means to print an error message).
I would ask that it at least be a "recommends". This message is muchu
useful, and finding out it is not displayed in DMD release mode was a
major disappointment.
Updated proposed text:
The expression assert(0) is a special case; it signifies code that
should be unreachable. Either AssertError is thrown at runtime if
reached or execution terminated. In the later case, it is recommended
that the implementation print the assert message to stderr (or
equivalent) before terminating. The optimization and code generation
phases of the compilation may assume that any code after the assert(0)
is unreachable.
Shachar
More information about the Digitalmars-d
mailing list