public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9474: GCC freezes in compiling a weird code mixing <iostream> and <iostream.h>
@ 2003-01-28 11:56 t-gcc
  0 siblings, 0 replies; only message in thread
From: t-gcc @ 2003-01-28 11:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9474
>Category:       c++
>Synopsis:       GCC freezes in compiling a weird code mixing <iostream> and <iostream.h>
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 28 11:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     t-gcc@snowelm.com
>Release:        gcc version 3.2.2 20030109 (Debian prerelease)
>Organization:
>Environment:
Debian GNU/Linux with kernel 2.4.20
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.2/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,pascal,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2.2 20030109 (Debian prerelease)
>Description:
When I try to compile the following C++ source code, cc1plus never finishes and runs forever.

------------------ temp.cc
#include <iostream>
typedef std::istream istream;
#include <iostream.h>
------------------ temp.cc (end)

Of course the source is weird, but gcc should report some error and exit. 
I ran into this problem when managing a C++ code
using flex 2.5.4a.
The <FlexLexer.h> attached to the latest flex source code still uses <iostream.h>, but I want to switch <iostream>...
>How-To-Repeat:
$ cat temp.cc

#include <iostream>
typedef std::istream istream;
#include <iostream.h>

$ g++ temp.cc
In file included from /usr/include/c++/3.2/backward/iostream.h:31,
                 from temp.cc:3:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.

... compiles forever ...
>Fix:
Avoid using <iostream.h>
In my case, it requires rewriting on <FlexLexer.h>...
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-28 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-28 11:56 c++/9474: GCC freezes in compiling a weird code mixing <iostream> and <iostream.h> t-gcc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).