This is the mail archive of the gcc-prs@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/5041: Zero-length arrays initialized by {}; cause gcc-3.0 to segfault



>Number:         5041
>Category:       c
>Synopsis:       Zero-length arrays initialized by {}; cause gcc-3.0 to segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 07 05:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Wladimir Mutel
>Release:        3.0.2 (Debian) (Debian testing/unstable)
>Organization:
Information System Development
>Environment:
System: Linux fluffy.isd.dp.ua 2.4.16 #2 Tue Dec 4 11:17:53 EET 2001 i686 unknown
Architecture: i686

	
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
	I tried to build AT&T Cyclone 0.2 with gcc-3.0, and it trapped. Here is a sample to demonstrate an idea:
	int main ()
	{
	  int t[0] = {};
	  int *p=t;
	}
	Running gcc-3.0 sample.c
	gives this:
	sample.c: In function `main':
	sample.c:4: Internal error: Segmentation fault
	Please submit a full bug report,
	with preprocessed source if appropriate.
	See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
	gcc-2.95 and g++-3.0 compile the code withour problems.

>How-To-Repeat:
	Just put these 5 lines of code in the file and compile it with gcc-3.0
	No preprocessor involved.
>Fix:
	AT&T Cyclone was succesfully compiled with gcc-2.95

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