26 May
2017
26 May
'17
11:03 a.m.
Andrzej Krzemienski wrote:
This is only one way of looking at it. Another one is that I have function like, `open_file`, I want it to either return the file handle or the information about run-time situation that prevented opening the file. "reading from uninitialized `expected`" is no such situation: it is simply a bug.
As I say in the paragraph immediately before, if your open_file calls open_file_impl, feeding it invalid arguments, this is simply a bug. Yet when open_file_impl returns EINVAL to indicate invalid arguments, and you return that back to the caller, you end up in the exact same situation.