-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strerror() wherever possible #263
Comments
I think iio_attr and iio_info already do this. Which other examples did you have in mind? |
There's |
Ok - a little check...
which isn't too bad - but
those need some work/care... |
As I remember, I created this issue because of some repeated reports on EZ would be "running example/code X, I get -22"; I forget which examples they were providing, but likely some of them were Not sure how much reduction in EZ questions [of this sort] we'd get by doing this; I just added it here, so I won't forget about it. |
The warn_unused_result attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. This is normally useful for functions where not checking the result is either a security problem or normally bug, but can just point out problems in end user code. As various backends (USB, Ethernet) are sometimes not 100%, this helps ensure that users are checking for various error codes, and hopefully geting meaningful error messages, as requested in #263. However, this would make most code pretty noisey to compile, only turn this on if asked (ie someone defines IIO_CHECK_RET) Signed-off-by: Robin Getz <[email protected]>
The warn_unused_result attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. This is normally useful for functions where not checking the result is either a security problem or normally bug, but can just point out problems in end user code. As various backends (USB, Ethernet) are sometimes not 100%, this helps ensure that users are checking for various error codes, and hopefully geting meaningful error messages, as requested in #263. However, this would make most code pretty noisey to compile, only turn this on if asked (ie someone defines IIO_CHECK_RET) Signed-off-by: Robin Getz <[email protected]>
i guess i'll close this for now; |
Some error reports are "I get code X", which prompts questions.
We could mitigate this by putting
strerror()
wherever possible, to also print strerror() strings.Especially in examples
The text was updated successfully, but these errors were encountered: