[Bug c/11231] New: undefined array size inside struct cause segfault with -g
eranian at hpl dot hp dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 18 00:54:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11231
Summary: undefined array size inside struct cause segfault with
-g
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: eranian@hpl.hp.com
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: gcc version 3.4 20030507 (experimental)
GCC host triplet: ia64-hp-linux
GCC target triplet: ia64-hp-linux
If you compile the following code sequence as follows:
/opt/gcc-pre3.4/bin/gcc -Wall -c -O2 test.c -g
test.c:2: error: `HASH_SIZE' undeclared here (not in a function)
test.c:3: internal compiler error: Segmentation fault
Please submit a full bug report,
% cat test.c
typedef struct {
int fd_hash[HASH_SIZE];
} pfmon_task_worker_t;
If you drop -g, it works. If the array is declared outside of the struct
you get the expected error message.
More information about the Gcc-bugs
mailing list