This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
fflush not working on egcs-2.91.66 (linux kernel 2.2.5-15)
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: fflush not working on egcs-2.91.66 (linux kernel 2.2.5-15)
- From: "anand.vadul"<anand dot vadul at computerconcepts dot com>
- Date: Tue, 31 Aug 99 14:19:09 -0500
Hi folks,
This is a very simple program going hay wire.
fflush does not flush!
The same program works perfectly
in - GCC on a Sun Solaris
- MSVC++ 6.0 (DOS mode)
Any help is greatly appreciated.
Thanks,
- Anand Vadul
ps:
Hardware : redhat-linux 6.0
Standard kernel 2.2.5-15
GCC : Built in : egcs-2.91.66 19990314/Linux(egcs-1.1.2 release)
------------------------ begin ---------------
#include <stdio.h>
int main()
{
char c;
fflush(stdin);
for(;;) {
printf("Enter C:");
c=getchar();
fflush(stdin);
printf("C got is :%c\n",c);
}
return 0;
}
------------------------ end -----------------
Inputs :
h
he
hel
help
Expected result : Actual Result
Enter C :h Enter C :h
C got is :h C got is :hEnter C :
Enter C :he C got is :Enter C :he
C got is :h C got is :hEnter C:
Enter C :hel C got is :eEnter C:
C got is :h C got is :
........