Article View: gnu.gcc.help
Article #50783bug report gcc 2.4.5
From: Stefan M. King
Date: Tue, 24 Aug 1993 14:36
Date: Tue, 24 Aug 1993 14:36
64 lines
2257 bytes
2257 bytes
WHAT: Bug in gcc 2.4.5 (I think) with fstreams
PLATFORM: SUN sparc
OS: 4.1.2
ipx% g++ -H testgnu.cc
/usr/local/lib/g++-include/fstream.h
/usr/local/lib/g++-include/iostream.h
/usr/local/lib/g++-include/streambuf.h
/usr/local/lib/g++-include/_G_config.h
testgnu.cc: In function `int main ()':
testgnu.cc:21: no member function `fstream::operator <<'
testgnu.cc:25: no member function `fstream::operator <<'
testgnu.cc:26: no member function `fstream::operator <<'
testgnu.cc:27: no member function `fstream::operator <<'
testgnu.cc:28: no member function `fstream::operator <<'
testgnu.cc:29: no member function `fstream::operator <<'
ipx%
Here is testgnu.cc:
#include <fstream.h>
int main(void)
{
fstream * pfst;
char c = 66; // declare various data types...
unsigned char uc = 66;
float f = 666.0;
double d = 666.0;
int i = 666;
unsigned int u = 666;
long l = 666;
unsigned long int ul = 666;
long unsigned int lu = 666;
char * pstr = "astring";
pfst = new fstream("A_test_file", ios::in|ios::out);
*pfst << c; // line 21
*pfst << uc;
*pfst << f;
*pfst << d;
*pfst << i;
*pfst << u;
*pfst << l;
*pfst << ul;
*pfst << lu;
*pfst << pstr;
}
Conclusion: it works with floats, doubles, and strings, only.
The dates on the include files are all from the installation of
gcc 2.2 back in 1992. Also, I had to edit _G_config.h to define size_t
as long unsigned int some time ago to make gcc2.4.5 work at all. This indicates
that maybe I had an installation problem which is perhaps the root of this evil
as well.
All the best at gnu!
-Stefan
Technical Details
Message-ID:
<9308241405.AA24507@ktaadn>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ktaadn.UUCP!stefanShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,c390460c96b4730e,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-08-24 08:04:13 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ktaadn.UUCP!stefan From: stefan@ktaadn.UUCP (Stefan M. King) Newsgroups: gnu.gcc.help Subject: bug report gcc 2.4.5 Date: 24 Aug 1993 10:36:12 -0400 Organization: GNUs Not Usenet Lines: 64 Sender: daemon@cis.ohio-state.edu Distribution: gnu Message-ID: <9308241405.AA24507@ktaadn>