public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/10924] New: Entering incorrect information to scanf breaks scanf.
@ 2003-05-22  4:10 gaffneyc@student.gvsu.edu
  0 siblings, 0 replies; only message in thread
From: gaffneyc@student.gvsu.edu @ 2003-05-22  4:10 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10924

           Summary: Entering incorrect information to scanf breaks scanf.
           Product: gcc
           Version: 3.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gaffneyc@student.gvsu.edu
                CC: gcc-bugs@gcc.gnu.org

When using scanf and you enter an incorrect value ie (scanf("%lf", &var) and 
you enter a scanf breaks and each succesive call will simply be passed by.

Some example code:
doube *myVar;
while(!scanf("%d", myVar)) {
    puts("Incorrect");
    rewind(stdin);
}

Should reask the user for scanf but instead it will continue looping. The 
problem is that stdin is not being set to EOF. I tried under the default cygwin 
gcc version and gcc 3.2.2 under gentoo linux. Bother give the same result. When 
compiled under mingw and visual c compiler it works as expected.



------- 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] only message in thread

only message in thread, other threads:[~2003-05-22  3:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-22  4:10 [Bug c/10924] New: Entering incorrect information to scanf breaks scanf gaffneyc@student.gvsu.edu

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