Red Hat Bugzilla – Bug 21298
gcc crashes on undef symbol as initialized array size
Last modified: 2007-04-18 12:30:01 EDT
gcc crashes when compiling following source
int a[SOME_UNDEFINED_SYMBOL] =
where SOME_UNDEFINED_SYMBOL is some undefined symbol.
(It does not depend on what follows the `=' so nothing is as good as
anything else, gcc never gets there.)
Using an undefined symbol as array size is clearly an error, but it
shouldn't crash the compiler.
gcc version: 2.96-54 from RedHat Linux 7.0, not modified
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
Command used to compile (assume the source is called g.c):
gcc -c g.c
g.c:1: `SOME_UNDEFINED_SYMBOL' undeclared here (not in a function)
g.c:1: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
Nevertheless they state I should report gcc-2.96 bugs to OS vendor.
Fixed since I think gcc-2.96-61, definitely in current gcc-2.96-64.