I can't figure out what the lifetime of a compound literal is; is it valid
for the function or only for the block. For instance, is the following
okay?
struct example {
char *str;
};
void func(void) {
struct example *e;
do {
e = &(struct example){};
e->str = (char []){ "hello world!" };
} while(0);
/* Is e undefined now? */
printf("%s\n",e->str);
}
TIA,
Bill