Article View: gnu.g++.lib.bug
Article #122Bug in File::tell
From: Steve Kearns
Date: Thu, 10 Aug 1989 18:10
Date: Thu, 10 Aug 1989 18:10
28 lines
1041 bytes
1041 bytes
I think the following is a bug, but I wonder cause one would think it would
have been found previously. From File.h:
inline long File::tell()
{
failif (!is_open() || (stat = ftell(fp) < 0));
return stat;
}
but < has tighter precedence than = , so this says
inline long File::tell()
{
failif (!is_open() || (stat = (ftell(fp) < 0)));
return stat;
}
which is wrong. Right would be:
inline long File::tell()
{
failif (!is_open() || ((stat = ftell(fp)) < 0));
return stat;
}
Technical Details
Message-ID:
<6446@columbia.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!cs.utexas.edu!sun-barr!rutgers!columbia!read.columbia.edu!kearnsReferences:
<8908051856.AA21241@AENEAS.MIT.EDU> <8908061131.AA01681@g.oswego.edu.Oswego.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!cs.utexas.edu!sun-barr!rutgers!columbia!read.columbia.edu!kearns From: kearns@read.columbia.edu (Steve Kearns) Newsgroups: gnu.g++.lib.bug Subject: Bug in File::tell Message-ID: <6446@columbia.edu> Date: 10 Aug 89 18:10:30 GMT References: <8908051856.AA21241@AENEAS.MIT.EDU> <8908061131.AA01681@g.oswego.edu.Oswego.EDU> Sender: news@columbia.edu Reply-To: kearns@cs.columbia.edu Distribution: gnu Organization: Columbia University Department of Computer Science Lines: 28