The use of the warn_unused_result attribute in the declaration of fwrite is undesirable, since it is perfectly legitimate to use fwrite without inspecting its return value. In that case, one can still detect failure via ferror. That libc declares fwrite with this attribute causes inordinate trouble for those who try to avoid gcc warnings about this attribute. Patch below.
Created attachment 4956 [details] remove fwrite's __wur attribute
This is particularly true since fputc is declared without __wur - consistency demands that both or neither should have the attribute, and I strongly favor neither based on the number of bug reports that have been falsely attributed to gnulib as a result of glibc's header markup on fwrite. For example: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/22751
See also this gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 where the suggested hammer is to completely disable ALL warn_unused_result checking in order to silence spurious warnings for fwrite(). I'd rather remove the __wur from fwrite than turn off what would otherwise be a useful gcc feature for functions where warning really does make sense.
Thanks, your patch has been added to git.
*** Bug 260998 has been marked as a duplicate of this bug. *** Seen from the domain http://volichat.com Page where seen: http://volichat.com/adult-chat-rooms Marked for reference. Resolved as fixed @bugzilla.