Mail Archives: djgpp/2002/06/21/12:31:02
Message-ID: | <000901c21940$5f955a20$04c5afc3@n>
|
From: | selimdeli AT ttnet DOT net DOT tr (selim delioglu)
|
To: | <djgpp AT delorie DOT com>
|
Subject: | Wrong behaviour in c++ program/ using gcc&gpp 3.1
|
Date: | Fri, 21 Jun 2002 19:26:11 +0300
|
MIME-Version: | 1.0
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook Express 6.00.2600.0000
|
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000
|
Reply-To: | djgpp AT delorie DOT com
|
[selim@~/c]$ set
BASH=d:/djgpp/bin/bash
BASH_VERSINFO=([0]="2" [1]="04" [2]="7" [3]="1" [4]="release"
[5]="i686-pc-msdosdjgpp")
BASH_VERSION='2.04.7(1)-release'
BLASTER='a220 i5 d1 p330'
CMDLINE=bash.exe
COLUMNS=80
COMSPEC=C:/COMMAND.COM
CONFIG=normal
CONFIG_SITE=d:/djgpp/share/config.site
DIRSTACK=()
DJDIR=d:/djgpp
DJGPP='d:\djgpp\djgpp.env'
EMU387=d:/djgpp/bin/emu387.dxe
EUID=42
GO32STUB=d:/djgpp/bin/stubify.exe
GROUP=root
GROUPS=()
GRXFONT=d:/djgpp/contrib/grx243/fonts
HISTFILE=d:/q/_bhist
HISTFILESIZE=500
HISTSIZE=500
HOME=d:/q
HOSTNAME=pc
HOSTTYPE=i686
LFN=y
LINES=25
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;
33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.
arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31
:*.gz=01;31:*.deb=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35'
MACHTYPE=i686-pc-msdosdjgpp
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=msdosdjgpp
PATH='c:/windows;c:/windows/command;d:/djgpp/bin;.'
PIPESTATUS=([0]="0")
PPID=1
PROMPT='$p$g'
PS1='[\u@\w]\$ '
PS2='> '
PS4='+ '
PWD=d:/djgpp
SHELL='C:\COMMAND.COM'
SHELLOPTS=braceexpand:hashall:histexpand:history:interactive-comm
ents:emacs
SHLVL=1
TEMP='C:\windows\temp'
TEXMFMAIN=d:/djgpp/share/texmf
TMP='c:\windows\temp'
TMPDIR=c:/windows/temp
UID=42
USER=selim
winbootdir='C:\WINDOWS'
windir='C:\WINDOWS'
[selim@~/c]$ gcc -v
Reading specs from d:/djgpp/lib/gcc-lib/djgpp/3.1/specs
Configured with: ../configure i586-pc-msdosdjgpp
--prefix=/dev/env/DJDIR --disable-nls
Thread model: single
gcc version 3.1
[selim@~/c]$ cat /dev/env/DJDIR/manifest/djdev203.ver
djdev203 Development Kit and Runtime (12/2001 Refresh)
/* Executables from bnu2112b.zip and djdev203.zip have
last modification dates: 24/12/2001 and 25/12/2001 */
[selim@~/c]$ cat getline.cpp
#include <iostream>
using namespace std;
int main() {
char buffer[100];
cin.getline(buffer, 100);
cout << buffer << endl;
return 0;
}
[selim@~/c]$ gpp -o getline.exe -Wall -O2 getline.cpp
/* no warnings or errors, executable created successfully */
------------------------------------------------------------
Here comes the problem. I am using DJGPP without problems for a
long time (more than one year). I used before (gcc & gpp) 2.95.3, and
later upgraded to gcc&gpp 3.0.4. After I upgraded to gcc 3.1 I found
a misbehaviour for the above code.
Normal behaviour is that: after running the program user enters
one line ending with a newline and the program displays that line
again. But after upgrading to gcc 3.1 & gpp 3.1 I have to press
"enter" twice to end the input to the program. I think that this
is a bug in the c++ library that comes with gpp 3.1, because with
the same c library (from djdev203.zip) the program runs as expected,
if I use gcc&gpp 3.0.4 or gcc&gpp 2.95.3.
I am using Win98SE with 128 MB of RAM, CPU Celeron 666
- Raw text -