|
From: Segher B. <se...@ke...> - 2012-11-23 11:41:54
|
> libusb on purpose doesn't check application data, and adding checks > would need to be not just in libusb_init but in every function for > every parameter. That was never really desirable, even during design > discussion for the 1.0 API many years ago. Returning an error for "bad parameter" for this makes debugging harder as well: instead of getting a nice hard crash where the problem happens, your application only see the error later (if it checks at all!) and at that time you cannot in general see the passed parameters anymore (and you're in the dark *which* param was wrong anyway). Such errors are rather useless anyway: the only reasonable thing the app can do when it gets one is an emergency stop, because _it has done something wrong itself_. Segher |