13 Sep 2008 23:41
Re: __attribute__((warn_unused_result)) for NetBSD?
der Mouse <mouse <at> Rodents-Montreal.ORG>
2008-09-13 21:41:00 GMT
2008-09-13 21:41:00 GMT
>> [...] __attribute__((warn_unused_result)) [...] >> It is interesting to hear/see NetBSD developer's opinions. First off, I think that should be __warn_unused_result__. warn_unused_result is in user namespace. > More complete list of "protected" functions in glibc-2.7: For functions like abs() which do not do anything except for their return value, this is reasonable - or, at least, not unreasonable. For functions like asprintf, or chdir, or even dup, which have potentially useful side effects as well as return values, I would call this somewhere between "obnoxious" and "broken" (exactly where on that spectrum I'd place it would depend on my mood of the moment). (Yes, there are uses of chdir for which ignoring the return is reasonable; there are even a few for dup, whose return value is predictable under some circumstances.) /~\ The ASCII der Mouse \ / Ribbon Campaign X Against HTML mouse <at> rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
RSS Feed