This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9474: GCC freezes in compiling a weird code mixing <iostream> and <iostream.h>


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]