Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Keith Dorken
Tue, 14 Apr 1992 17:21
GCC (C++) 2.01 - additional info
Author: Keith Dorken
Date: Tue, 14 Apr 1992 17:21
Date: Tue, 14 Apr 1992 17:21
51 lines
1970 bytes
1970 bytes
The bug in GCC that causes the compiler to go into an infinite loop during parsing
has been isolated even further in the following (smaller!) sample code.
You can eliminate any one section of the code surrounded by BUG, BUG1 or BUG2,
and the parsing problem goes away. Any known fixes would be appreciated..
This is the .h header file. To reproduce, put everything below "SAMPLE" into a
bug.h file, create a bug.cc file with '#include "bug.h"' in it, and compile with
c++ -c bug.cc
This problem is for the compiler identified by
Reading specs from /n/server/usr/local/languages/gnu-compilers/lib/gcc-lib/sun4os4/2.1/specs
gcc version 2.1
/n/server/usr/local/languages/gnu-compilers/lib/gcc-lib/sun4os4/2.1/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix junk.cc /usr/tmp/cca13962.i
GNU CPP version 2.1 (sparc)
---------- SAMPLE ----------
#define BUG // remove either BUG
#define BUG1 // or BUG1
#define BUG2 // or BUG2 and the parsing problem goes away.
class Unsigned36
{
protected:
char* rep;
public:
Unsigned36();
#ifdef BUG2
Unsigned36(int);
#endif
operator int();
#ifdef BUG
friend
#endif
int operator == (const Unsigned36&, const Unsigned36&);
};
int operator ! (const Unsigned36& x);
inline Unsigned36::Unsigned36() : rep( (char *)0 )
{
}
inline unsigned int Unsigned36::operator int()
{
return ( rep[0] );
}
inline int operator ! ( Unsigned36& x )
{
#ifdef BUG1
return( x == 0 );
#endif
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads