public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/11959] New: fwrite must not be declared with the warn_unused_result attribute
@ 2010-08-30 20:33 jim at meyering dot net
  2010-08-30 20:46 ` [Bug libc/11959] " jim at meyering dot net
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jim at meyering dot net @ 2010-08-30 20:33 UTC (permalink / raw)
  To: glibc-bugs

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.

-- 
           Summary: fwrite must not be declared with the warn_unused_result
                    attribute
           Product: glibc
           Version: 2.13
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: jim at meyering dot net
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11959

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11959] fwrite must not be declared with the warn_unused_result attribute
  2010-08-30 20:33 [Bug libc/11959] New: fwrite must not be declared with the warn_unused_result attribute jim at meyering dot net
@ 2010-08-30 20:46 ` jim at meyering dot net
  2010-08-30 21:11 ` eblake at redhat dot com
  2010-08-31 11:10 ` eblake at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jim at meyering dot net @ 2010-08-30 20:46 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From jim at meyering dot net  2010-08-30 20:32 -------
Created an attachment (id=4956)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4956&action=view)
remove fwrite's __wur attribute


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11959

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11959] fwrite must not be declared with the warn_unused_result attribute
  2010-08-30 20:33 [Bug libc/11959] New: fwrite must not be declared with the warn_unused_result attribute jim at meyering dot net
  2010-08-30 20:46 ` [Bug libc/11959] " jim at meyering dot net
@ 2010-08-30 21:11 ` eblake at redhat dot com
  2010-08-31 11:10 ` eblake at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: eblake at redhat dot com @ 2010-08-30 21:11 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From eblake at redhat dot com  2010-08-30 20:46 -------
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

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eblake at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11959

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11959] fwrite must not be declared with the warn_unused_result attribute
  2010-08-30 20:33 [Bug libc/11959] New: fwrite must not be declared with the warn_unused_result attribute jim at meyering dot net
  2010-08-30 20:46 ` [Bug libc/11959] " jim at meyering dot net
  2010-08-30 21:11 ` eblake at redhat dot com
@ 2010-08-31 11:10 ` eblake at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: eblake at redhat dot com @ 2010-08-31 11:10 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From eblake at redhat dot com  2010-08-30 21:11 -------
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.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11959

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-30 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-30 20:33 [Bug libc/11959] New: fwrite must not be declared with the warn_unused_result attribute jim at meyering dot net
2010-08-30 20:46 ` [Bug libc/11959] " jim at meyering dot net
2010-08-30 21:11 ` eblake at redhat dot com
2010-08-31 11:10 ` eblake at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).