Compiler error #40 report

Stephen Friedl
Wed Mar 22 16:54:00 GMT 2000

 * gccbug.cpp
 *	This little tiny program provokes a compiler bug in GCC "egcs-2.91.66" on
 *	a RedHat Linux 6.1 system. The C preprocessor output has been stripped down of
 *	everything that is not necessary to reproduce the bug.
 *	The source code is clearly not valid C++ -- we know this -- but the error
 *	message asked us to report it. We believe this is not the latest version of
 *	the compiler, but I was not willing to locate a newer build just to report
 *	this bug. If the bug doesn't exist in the current version, of course please
 *	just drop this on the floor. Instead I put my time into making an easy-to-follow
 *	bug report that lives in a single file and is less than 3000 lines long.
 *	I hope this is helpful.
 *	-- Stephen J. Friedl / / 2000-03-22

$ uname -a
Linux 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown

$ egcs -v -c gccbug.cpp

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs

gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 \
	-D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ \
	-D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) \
	-D__EXCEPTIONS -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ \
	-D__tune_i386__ gccbug.cpp /tmp/cc2V90Te.ii
GNU CPP version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/cc1plus /tmp/cc2V90Te.ii -quiet -dumpbase \
	-version -o /tmp/ccMxktzl.s

GNU C++ version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) (i386-redhat-linux) \
	compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
gccbug.cpp: In function `void format1()':
gccbug.cpp:66: warning: invalid use of type decl `typedef short int date' as expression
gccbug.cpp:66: warning: initialization to `char *' from `date' lacks a cast
gccbug.cpp:66: Internal compiler error 40.
gccbug.cpp:66: Please submit a full bug report to `'.
gccbug.cpp:66: See <URL: > for details.


typedef short date;

struct { } ar;

static void

char	*p =;		/* BUG IS HERE */


More information about the Gcc-bugs mailing list