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

--- Comment #7 from Marco Leise <[email protected]> ---
(In reply to Jakob Ovrum from comment #5)
> 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.

The cleanest would still be to always check the error code from FormatMessage,
even in case of correct input, just because it gives no guarantees about
success in the documentation.

--

Reply via email to