Re: __attribute__((warn_unused_result)) for NetBSD?

Aleksey Cheusov <[email protected]>
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>
 >> I already made my desicion years ago - in programming paranoia is good.

> There's necessarily a tradeoff between paranoia and pragmatism.
> Finding the right balance is essential.

...and every developer think that his balance is best of the best :-)

 >> Variants:
 >> 1) this mark is useless at all
 >> 2) only for functions with no side effects
 >> 3) for some functions that may fail (read, write etc.)
 >> 4) 2 + 3

> Setting warn-unused-result on that may fail is nearly useless.
Why??? :-)

> You
> want warn-missing-failure-check, which is a lot harder to implement.
> Warn-unused-result is not an adequate substitute

You mix up a NECESSITY and SUFFICIENCY.  In order to make checks for
failures it is NECESSARY to check a return value, but nobody says it
is SUFFICIENT. But if CHECKS FOR FAILURE IS NECESSARY,
warn-unused-result does its job, it implements minimal checks and
produces appropriate warnings/errors. Of course, warn-unused-result
cannot replace human :-)

-- 
Best regards, Aleksey Cheusov.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.