From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 Description of problem: Bug report 77350 describes a similar situation, where feeding a bad struct initializer to gcc 2.96 causes an unspecified internal error. However, I've experienced the same results with a different compiler version to the one described therein. The reporter in that case said that gcc 2.9x was not affected; this is not what I've seen. This problem is not serious in the slightest, because if I fix my code it stops happening. ######################## Sample code: #include <stdlib.h> struct innerstruct { const char * const * values; } innerstruct; struct outerstruct { const struct innerstruct *fields; } list_of_things[] = { { /* if I mis-spell the name of the struct in the cast, * the compiler exits unhappily */ (const struct innerstruct_wrong []) { { (const char * const []) { "blah", NULL } }, { NULL } } }, { NULL } }; ######################## Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. save the provided sample code to a file 2. type 'gcc -c <file>' Actual Results: The compiler aborts with an error message asking me to submit a bug report: crashgcc.c:15: warning: excess elements in struct initializer crashgcc.c:15: warning: (near initialization for `(anonymous)[0]') crashgcc.c:18: warning: excess elements in struct initializer crashgcc.c:18: warning: (near initialization for `(anonymous)[1]') crashgcc.c:20: warning: initialization from incompatible pointer type crashgcc.c:22: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Expected Results: Something similar to the above, perhaps with a warning about a struct type being declared inside the initializer, and without the bit about the segmentation fault. Additional info:
No ICE with gcc 3.2.3-20.