Skip to content

Commit

Permalink
Add an optional warn_unused_result attribute to functs which return vals
Browse files Browse the repository at this point in the history
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
rgetz committed Feb 21, 2020
1 parent e8da44b commit bf452ed
Showing 1 changed file with 125 additions and 119 deletions.
Loading

0 comments on commit bf452ed

Please sign in to comment.