https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89667
--- Comment #5 from Rick Greer ---
OK, now I get it. The array of pointers is, indeed, static but the compiler is
trying to allocate the data that those pointers reference on the stack! I was
confused by the fact that C++ lets me do this:
v
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89667
--- Comment #3 from Rick Greer ---
Thanks guys, the compound literal works for me.
But can you explain why:
static char *foo[] = { (char []){"this compiles ..."} };
void but() { static char *bar[] = { (char []){"this doesn't!"} }; }
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: rick at regreer dot net
Target Milestone: ---
Created attachment 45943
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45943&action=edit
See descrip