[Bug c/89667] initializers for character string arrays (char *[]) appear to reside in protected storage

2019-03-16 Thread rick at regreer dot net
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

[Bug c/89667] initializers for character string arrays (char *[]) appear to reside in protected storage

2019-03-15 Thread rick at regreer dot net
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!"} }; }

[Bug c/89667] New: initializers for character string arrays (char *[]) appear to reside in protected storage

2019-03-11 Thread rick at regreer dot net
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