This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Compiles and core dumps
- To: "Stefan Drees" <Stefan dot Drees at dlr dot de>
- Subject: Re: Compiles and core dumps
- From: "Bruce Eckel" <Bruce at EckelObjects dot com>
- Date: Wed, 6 Jan 1999 09:52:21 -0800
- Cc: <egcs-bugs at cygnus dot com>
- Reply-To: "Bruce Eckel" <Bruce at EckelObjects dot com>
Ooh! How embarrasing. Thanks. I'll have to go through the rest of the book
and make sure I've done that in all the examples. Sorry for the extra noise.
=============================
Bruce Eckel http://www.BruceEckel.com
Contains free electronic books: "Thinking in Java" & "Thinking in C++ 2e"
-----Original Message-----
From: Stefan Drees <sdrees@qwdb.rs.kp.dlr.de>
To: Bruce Eckel <Bruce@EckelObjects.com>
Cc: egcs-bugs@cygnus.com <egcs-bugs@cygnus.com>
Date: Wednesday, January 06, 1999 12:30 AM
Subject: Re: Compiles and core dumps
>Hm,
>everyone hates this, but it works for me #:^))
># Reading specs from
># /opt/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.60/specs
># gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
>well after I changed the source name to "StreamIt.cpp". So instead
>of telling You about my environment, could it be, that there is a problem
>with case, like "streamit.cpp".
>Anyway, after an "ifstream maybe("some_name");" it would be nice
>to verify the existence via some code like
>e.g. "if ( maybe.is_open() )", wouldn't it?
>
>Later,
> s t e f a n.
>
>On Tue, 5 Jan 1999, Bruce Eckel wrote:
>:-) This compiles fine, but core dumps when you run it (RedHat Linux 5.2,
>:-) Reading specs from
>:-) /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.92.33/specs
>:-) gcc version egcs-2.92.33 19981226 (gcc2 ss-980609 experimental)
>:-)
>:-)
>:-) //: C20:StreamIt.cpp
>:-) // From Thinking in C++, 2nd Edition
>:-) // at http://www.BruceEckel.com
>:-) // (c) Bruce Eckel 1999
>:-) // Copyright notice in Copyright.txt
>:-) // Iterators for istreams and ostreams
>:-) #include <iostream>
>:-) #include <fstream>
>:-) #include <vector>
>:-) #include <string>
>:-) using namespace std;
>:-)
>:-) int main() {
>:-) ifstream in("StreamIt.cpp");
>:-) istream_iterator<string> init(in), end;
>:-) ostream_iterator<string> out(cout, "\n");
>:-) vector<string> vs;
>:-) copy(init, end, back_inserter(vs));
>:-) copy(vs.begin(), vs.end(), out);
>:-) out = vs[0];
>:-) out = "That's all, folks!";
>:-) } ///:~
>:-)
>---
>Day: Stefan Drees <sdrees@acm.org>, Phone ++49 2203 601 - 3542
>Night: Stefan Drees <sdrees@manchmal.rhein.de>, Phone ++49 228 934 35 14
>Browse: http://www.sdrees.de/stefan/
>
>