This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[3.0.3, 2.95.3] Endless loop with strstream.h included w/o instream.h
- From: linguist-gcc at rich-paul dot net
- To: gcc at gcc dot gnu dot org
- Date: Wed, 16 Jan 2002 01:11:54 -0500
- Subject: [3.0.3, 2.95.3] Endless loop with strstream.h included w/o instream.h
The following bit of code, from the ddd configure script, puts cc1plus
into an endless loop on my system, running slackware linux 8.0. Adding
#include <iostream.h> b4 the strstream line fixes it. The endless loop occurs
under both 3.0.3 and gcc-2.95.3. Sorry 'bout the lame bug report, but I
haven't had time to put a real one together yet.
If this isn't repeatable elsewhere, don't hunt too hard: I can't repeat it on
my other linux box, using an older slackware and compiler 3.0.1, so I want to
remove/reinstall the compiler and libraries b4 anybody goes nuts chasing it.
-- cut --
#line 10430 "configure"
#include "confdefs.h"
#include <strstream.h>
int main() {
ostrstream os; os.rdbuf()->freeze(0);
; return 0; }
-- cut --
I this is the error message I get b4 it enters the loop:
-- cut --
In file included from /opt/gcc-3.0.3/include/g++-v3/bits/std_iostream.h:40,
from /opt/gcc-3.0.3/include/g++-v3/backward/iostream.h:32,
from assert.h:45,
from /opt/gcc-3.0.3/include/g++-v3/bits/std_cassert.h:37,
from /opt/gcc-3.0.3/include/g++-v3/bits/stl_alloc.h:61,
from /opt/gcc-3.0.3/include/g++-v3/bits/std_memory.h:50,
from /opt/gcc-3.0.3/include/g++-v3/bits/std_string.h:43,
from /opt/gcc-3.0.3/include/g++-v3/bits/localefwd.h:42,
from /opt/gcc-3.0.3/include/g++-v3/bits/std_ios.h:43,
from /opt/gcc-3.0.3/include/g++-v3/backward/strstream:53,
from /opt/gcc-3.0.3/include/g++-v3/backward/strstream.h:33,
from configure:10431:
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:61: template-id
`num_put<_CharT, std::ostreambuf_iterator<_CharT, _Traits> >' used as a
declarator
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:61: parse error before `;'
token
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:62: template-id
`ctype<_CharT>' used as a declarator
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:62: parse error before `;'
token
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:169: type specifier omitted
for parameter
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:169: default argument for
template parameter in function template `std::basic_ostream<_CharT,
_Traits>& std::ios_base::seekp(typename _Traits::off_type)'
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:169: template definition of
non-template `std::basic_ostream<_CharT, _Traits>&
std::ios_base::seekp(typename _Traits::off_type)'
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:169: invalid member template
declaration `std::basic_ostream<_CharT, _Traits>&
std::ios_base::seekp(typename _Traits::off_type)'
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:175: template definition of
non-template `std::basic_ostream<_CharT, _Traits>&
std::ios_base::operator=(const std::basic_ostream<_CharT, _Traits>&)'
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:175: invalid member template
declaration `std::basic_ostream<_CharT, _Traits>&
std::ios_base::operator=(const std::basic_ostream<_CharT, _Traits>&)'
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:177: parse error before `const
'
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h: In constructor
`std::basic_ostream<_CharT,
_Traits>::basic_ostream(std::basic_streambuf<_CharT, _Traits>*)':
/opt/gcc-3.0.3/include/g++-v3/bits/std_ostream.h:67: parse error before `;'
token
-- cut --
If I run it with -dy, the last 3 lines of the following output repeat forever.
-- cut --
Reducing via rule 24 (line 511), NAMESPACE identifier '{' @4 extdefs_opt '}' -> extdef
state stack now 0 1 4
Entering state 38
Reducing via rule 13 (line 484), @2 extdef -> lang_extdef
state stack now 0 1
Entering state 3
Reducing via rule 5 (line 452), extdefs lang_extdef -> extdefs
state stack now 0
Entering state 1
Reading a token: Next token is 342 (END_OF_SAVED_INPUT)
Reducing via rule 12 (line 480), -> @2
state stack now 0 1
Entering state 4
Next token is 342 (END_OF_SAVED_INPUT)
Shifting error token, Entering state 6
Next token is 342 (END_OF_SAVED_INPUT)
Discarding token 342 (END_OF_SAVED_INPUT).
Error: state stack now 0 1 4
Shifting error token, Entering state 6
Reading a token: Next token is 342 (END_OF_SAVED_INPUT)
Discarding token 342 (END_OF_SAVED_INPUT).
Error: state stack now 0 1 4
Shifting error token, Entering state 6
Reading a token: Next token is 342 (END_OF_SAVED_INPUT)
Discarding token 342 (END_OF_SAVED_INPUT).
Error: state stack now 0 1 4
Shifting error token, Entering state 6
Reading a token: Next token is 342 (END_OF_SAVED_INPUT)
Discarding token 342 (END_OF_SAVED_INPUT).
Error: state stack now 0 1 4
Shifting error token, Entering state 6
-- cut --
--
Got freedom? Vote Libertarian: http://www.lp.org