https://issues.dlang.org/show_bug.cgi?id=13541

Jakob Ovrum <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #5 from Jakob Ovrum <[email protected]> ---
(In reply to Walter Bright from comment #0)
> 1. sysErrorString()'s argument should ONLY be values returned by Windows
> APIs like GetLastError(), and so this should always succeed. 
> 2. recursively calling sysErrorString() with the SAME value will cause a
> stack overflow crash, not any usable exception.

As pointed out, it can fail, and it does not recurse with the same value. I
should have left a comment when I initially wrote it.

However, I agree with the desire for `nothrow`. I think the practical
compromise would be to replace the runtime error check for `FormatMessageW`
with an assert (that also uses assert(false) in the release path), then
document that the function only accepts valid Windows error codes.

--

Reply via email to