[Ksummit-discuss] [CORE TOPIC] More useful types in the linux kernel

Alexey Dobriyan adobriyan at gmail.com
Tue Jul 26 13:53:27 UTC 2016


On Tue, Jul 26, 2016 at 2:48 PM, David Woodhouse <dwmw2 at infradead.org> wrote:
> On Fri, 2016-07-22 at 15:57 +0200, Hannes Reinecke wrote:
>>
>> > I guess that almost all functions return only a few possible error codes?
>>
>> Precisely. If we had a way of specifying "the return value is an errno
>> with the possible values '0', '-EIO', and '-EINVAL'" that would be
>> _so_ cool.
>
> And perpetually out of date. Because functions call through to *other*
> functions which might return an errno outside the 'known' set.
>
> Any why would you *want* to know the precise set of errnos that a
> function might return, if not to deliberately code your error handling
> non-defensively?

Java has checked exceptions.
Obviously, people "catch (e) {}" them.


More information about the Ksummit-discuss mailing list