Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an optional warn_unused_result attribute to functs which return vals
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]>
- Loading branch information