tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: __attribute__((warn_unused_result)) for NetBSD?



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


Home | Main Index | Thread Index | Old Index