public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/14254] New: __wur on scanf and related functions is wrong
@ 2012-06-16 11:06 bugdal at aerifal dot cx
  2013-10-17 12:28 ` [Bug stdio/14254] " neleai at seznam dot cz
  0 siblings, 1 reply; 2+ messages in thread
From: bugdal at aerifal dot cx @ 2012-06-16 11:06 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 14254
           Summary: __wur on scanf and related functions is wrong
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
        AssignedTo: unassigned@sourceware.org
        ReportedBy: bugdal@aerifal.cx
    Classification: Unclassified


A perfectly valid idiom for using scanf-family functions is to include %n in
your format string with the corresponding argument variables set in advance to
-1 or similar (so that if the %n is not reached, the program can tell). This is
particularly appropriate when the number of characters read, not the count of
items read, is what's more interesting to the program.

As such, __wur (warn unused result) should be removed from all scanf-family
functions.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug stdio/14254] __wur on scanf and related functions is wrong
  2012-06-16 11:06 [Bug stdio/14254] New: __wur on scanf and related functions is wrong bugdal at aerifal dot cx
@ 2013-10-17 12:28 ` neleai at seznam dot cz
  0 siblings, 0 replies; 2+ messages in thread
From: neleai at seznam dot cz @ 2013-10-17 12:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14254

Ondrej Bilka <neleai at seznam dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |neleai at seznam dot cz
         Resolution|---                         |WONTFIX

--- Comment #1 from Ondrej Bilka <neleai at seznam dot cz> ---
A %n usage is relatively rare and warnings are more useful.

As gcc does a type checking of scanf arguments you could ask gcc developers to
selectively enable/disable wur based on %n presence.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2013-10-17 12:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-16 11:06 [Bug stdio/14254] New: __wur on scanf and related functions is wrong bugdal at aerifal dot cx
2013-10-17 12:28 ` [Bug stdio/14254] " neleai at seznam dot cz

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