Re: __attribute__((warn_unused_result)) for NetBSD?

Aleksey Cheusov <[email protected]>
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>
 >> Today while trying to bootstrap pkgsrc under ALT Linux I've found that
 >> several functions such as fwrite, write, chdir and probably others
 >> are declared with __attribute__((warn_unused_result)) attribute.
 >>
 >> This obviously generates useful warning/errors for the key components
 >> of the system.

> Perhaps it could, but proper and regular use of "lint" will do this
> too, and far more.

May be. But only a few C developers use lint, most even don't know
about it :-). Decade ago and more C development was different...
Embedding such function as warn_unused_result into libc may improve
quality of C programs regardless of programmer's qualification or
accuracy.

2der Mouse:
Of couse declaring functions like abs(3) as
"warn_unused_result" is useless.  Not everything in glibc are "good things".
But idea in general is IMO very good and can improve NetBSD.
I hope this will be a direction of work one day.

-- 
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.