[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getch() waits even nodelay is set
From: |
Fangtu Qiu |
Subject: |
Re: getch() waits even nodelay is set |
Date: |
Sat, 20 Jul 2002 10:05:42 -0400 (EDT) |
RedHat 7.3 uses gcc 2.96-110.
More testing:
Same code works fine on RedHat 7.2 with both gcc and g++. The binary
compiled by g++ on RedHat 7.2 didn't work on 7.3.
Replacing ncurses 5.2-26 on RedHat 7.3 with version 5.2-12 from 7.2
distribution corrects the problem.
I checked the document of stream I/O. It says one should not mix with
stdio. But there is no stream I/O routine in the code I provided. This
confuses me.
-Fangtu
On Sat, 20 Jul 2002, Thomas Dickey wrote:
> On Fri, Jul 19, 2002 at 11:53:34PM -0400, Fangtu Qiu wrote:
> > Hi, Thomas,
> >
> > The problem appears after I upgraded my linux to RedHat 7.3 from RedHat
> > 7.2. If you only have 7.2, you may not be able to see the problem.
>
> I generally do re-installs (upgrades aren't reliable enough for my tastes).
> If 7.4 doesn't come along shortly, I'll probably look into 7.3 in a month
> or so. (I've a 6.2 and 7.2, for testing).
>
> > The following code will wait if compiled with g++. It won't wait if
> > compiled by gcc.
>
> g++ is a different case - its support for stdio and termio is philosophically
> opposed to allowing mixes of C and C++ code. So natural combinations fail to
> work because someone decides that because the standard does not assert that
> the
> facilities _must_ work together, then they're free to implement things in a
> way
> that prevents them from doing so.
>
> Usually (this isn't an faq, comes up 1-2 times a year) the problem surfaces
> when someone tries mixing stream I/O with stdio.
>
> However...
>
> It's not clear where the problem lies. Some more information might help
> guess. I don't think it's purely the compiler - I just now tweaked things
> to make all of ncurses build with g++ using the gcc 3.1 distribution. That
> (running on Slackware 7.1 with glibc 2.1.3) doesn't hang. (I modified the
> config.status after running configure - autoconf 2.52's check for libstdc
> blew up - and also added an extern-C ifdef to nc_alloc.h). iirc, Redhat
> 7.2 uses one of the 2.96 series. Does 7.3 also?
>
> > ===== cut here =====
> >
> > #include <curses.h>
> >
> > int main()
> > {
> > WINDOW * pwin = initscr();
> > nodelay(pwin, TRUE);
> > getch();
> > endwin();
> > }
> >
> > ===== cut here =====
> >
> > Regards,
> >
> > Fangtu Qiu
> >
> >
> > On Fri, 19 Jul 2002, Thomas E. Dickey wrote:
> >
> > > On Fri, 19 Jul 2002, Fangtu Qiu wrote:
> > >
> > > > Bug description:
> > > >
> > > > The getch() function waits for the input when nodelay is set.
> > > >
> > > > Bug or new behaviour? Or I missed something?
> > >
> > > I'm not sure what you are seeing - I use nodelay in several of the test
> > > programs. (Will check later, in case it's a Redhat bug - I have a 7.2
> > > for testing those).
> > >
> > > > Platform tested: RedHat linux 7.3
> > > >
> > > > ncurses version: 5.2-26 from RedHat 7.3 (getch WAITS when nodelay is
> > > > set)
> > > > ncurses version: 5.2-28 from RawHide (getch WAITS when nodelay is set)
> > > > ncurses version: 5.2-20020713 from ftp://dickey.his.com (getch WAITS
> > > > when
> > > > nodelay is set)
> > > >
> > > > ncurses version: 5.2-12 from RedHat 7.2 (getch doesn't wait when nodelay
> > > > is set)
> > > >
> > > > -Fangtu
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Bug-ncurses mailing list
> > > > address@hidden
> > > > http://mail.gnu.org/mailman/listinfo/bug-ncurses
> > > >
> > >
> > >
>
>